在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):angristan/openvpn-install开源软件地址(OpenSource Url):https://github.com/angristan/openvpn-install开源编程语言(OpenSource Language):Shell 100.0%开源软件介绍(OpenSource Introduction):openvpn-installOpenVPN installer for Debian, Ubuntu, Fedora, CentOS, Arch Linux, Oracle Linux, Rocky Linux and AlmaLinux. This script will let you setup your own secure VPN server in just a few seconds. You can also check out wireguard-install, a simple installer for a simpler, safer, faster and more modern VPN protocol. UsageFirst, get the script and make it executable: curl -O https://raw.githubusercontent.com/angristan/openvpn-install/master/openvpn-install.sh
chmod +x openvpn-install.sh Then run it: ./openvpn-install.sh You need to run the script as root and have the TUN module enabled. The first time you run it, you'll have to follow the assistant and answer a few questions to setup your VPN server. When OpenVPN is installed, you can run the script again, and you will get the choice to:
In your home directory, you will have If you have any question, head to the FAQ first. Please read everything before opening an issue. PLEASE do not send me emails or private messages asking for help. The only place to get help is the issues. Other people may be able to help and in the future, other users may also run into the same issue as you. My time is not available for free just for you, you're not special. Headless installIt's also possible to run the script headless, e.g. without waiting for user input, in an automated manner. Example usage: AUTO_INSTALL=y ./openvpn-install.sh
# or
export AUTO_INSTALL=y
./openvpn-install.sh A default set of variables will then be set, by passing the need for user input. If you want to customise your installation, you can export them or specify them on the same line, as shown above.
If the server is behind NAT, you can specify its endpoint with the Other variables can be set depending on your choice (encryption, compression). You can search for them in the Password-protected clients are not supported by the headless installation method since user input is expected by Easy-RSA. The headless install is more-or-less idempotent, in that it has been made safe to run multiple times with the same parameters, e.g. by a state provisioner like Ansible/Terraform/Salt/Chef/Puppet. It will only install and regenerate the Easy-RSA PKI if it doesn't already exist, and it will only install OpenVPN and other upstream dependencies if OpenVPN isn't already installed. It will recreate all local config and re-generate the client file on each headless run. Headless User AdditionIt's also possible to automate the addition of a new user. Here, the key is to provide the (string) value of the The following Bash script adds a new user #!/bin/bash
export MENU_OPTION="1"
export CLIENT="foo"
export PASS="1"
./openvpn-install.sh Features
CompatibilityThe script supports these OS and architectures:
To be noted:
ForkThis script is based on the great work of Nyr and its contributors. Since 2016, the two scripts have diverged and are not alike anymore, especially under the hood. The main goal of the script was enhanced security. But since then, the script has been completely rewritten and a lot a features have been added. The script is only compatible with recent distributions though, so if you need to use a very old server or client, I advise using Nyr's script. FAQMore Q&A in FAQ.md. Q: Which provider do you recommend? A: I recommend these:
Q: Which OpenVPN client do you recommend? A: If possible, an official OpenVPN 2.4 client.
Q: Am I safe from the NSA by using your script? A: Please review your threat models. Even if this script has security in mind and uses state-of-the-art encryption, you shouldn't be using a VPN if you want to hide from the NSA. Q: Is there an OpenVPN documentation? A: Yes, please head to the OpenVPN Manual, which references all the options. More Q&A in FAQ.md. One-stop solutions for public cloudSolutions that provision a ready to use OpenVPN server based on this script in one go are available for:
ContributingCode formattingWe use shellcheck and shfmt to enforce bash styling guidelines and good practices. They are executed for each commit / PR with GitHub Actions, so you can check the configuration here. Security and EncryptionOpenVPN's default settings are pretty weak regarding encryption. This script aims to improve that. OpenVPN 2.4 was a great update regarding encryption. It added support for ECDSA, ECDH, AES GCM, NCP and tls-crypt. If you want more information about an option mentioned below, head to the OpenVPN manual. It is very complete. Most of OpenVPN's encryption-related stuff is managed by Easy-RSA. Defaults parameters are in the vars.example file. CompressionBy default, OpenVPN doesn't enable compression. This script provides support for LZ0 and LZ4 (v1/v2) algorithms, the latter being more efficient. However, it is discouraged to use compression since the VORACLE attack makes use of it. TLS versionOpenVPN accepts TLS 1.0 by default, which is nearly 20 years old. With TLS 1.2 is supported since OpenVPN 2.3.3. CertificateOpenVPN uses an RSA certificate with a 2048 bits key by default. OpenVPN 2.4 added support for ECDSA. Elliptic curve cryptography is faster, lighter and more secure. This script provides:
It defaults to ECDSA with OpenVPN uses Data channelBy default, OpenVPN uses
Indeed, AES is today's standard. It's the fastest and more secure cipher available today. SEED and Camellia are not vulnerable to date but are slower than AES and relatively less trusted.
AES-256 is 40% slower than AES-128, and there isn't any real reason to use a 256 bits key over a 128 bits key with AES. (Source: 1,2). Moreover, AES-256 is more vulnerable to Timing attacks. AES-GCM is an AEAD cipher which means it simultaneously provides confidentiality, integrity, and authenticity assurances on the data. The script supports the following ciphers:
And defaults to OpenVPN 2.4 added a feature called "NCP": Negotiable Crypto Parameters. It means you can provide a cipher suite like with HTTPS. It is set to Control channelOpenVPN 2.4 will negotiate the best cipher available by default (e.g ECDHE+AES-256-GCM) The script proposes the following options, depending on the certificate:
It defaults to Diffie-Hellman key exchangeOpenVPN uses a 2048 bits DH key by default. OpenVPN 2.4 added support for ECDH keys. Elliptic curve cryptography is faster, lighter and more secure. Also, generating a classic DH keys can take a long, looong time. ECDH keys are ephemeral: they are generated on-the-fly. The script provides the following options:
It defaults to HMAC digest algorithmFrom the OpenVPN wiki, about
The script provides the following choices:
It defaults to
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论