Line 367: |
Line 367: |
| *Run the script and follow the on-screen prompts: | | *Run the script and follow the on-screen prompts: |
| wget https://git.io/vpn -O openvpn-install.sh && bash openvpn-install.sh | | wget https://git.io/vpn -O openvpn-install.sh && bash openvpn-install.sh |
| + | |
| + | *Example install using the defaults: |
| + | |
| + | Welcome to this OpenVPN road warrior installer! |
| + | |
| + | Which protocol should OpenVPN use? |
| + | 1) UDP (recommended) |
| + | 2) TCP |
| + | Protocol [1]: |
| + | |
| + | What port should OpenVPN listen to? |
| + | Port [1194]: |
| + | |
| + | Select a DNS server for the clients: |
| + | 1) Current system resolvers |
| + | 2) Google |
| + | 3) 1.1.1.1 |
| + | 4) OpenDNS |
| + | 5) Quad9 |
| + | 6) AdGuard |
| + | DNS server [1]: |
| + | |
| + | Enter a name for the first client: |
| + | Name [client]: |
| + | |
| + | OpenVPN installation is ready to begin. |
| + | Press any key to continue... |
| + | |
| + | Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB] |
| + | Hit:2 http://us.archive.ubuntu.com/ubuntu focal InRelease |
| + | Get:3 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB] |
| + | Get:4 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB] |
| + | Fetched 328 kB in 1s (488 kB/s) |
| + | Reading package lists... Done |
| + | Reading package lists... Done |
| + | Building dependency tree |
| + | Reading state information... Done |
| + | ca-certificates is already the newest version (20210119~20.04.1). |
| + | openssl is already the newest version (1.1.1f-1ubuntu2.4). |
| + | Suggested packages: |
| + | resolvconf openvpn-systemd-resolved easy-rsa |
| + | The following NEW packages will be installed: |
| + | openvpn |
| + | 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. |
| + | Need to get 0 B/477 kB of archives. |
| + | After this operation, 1,188 kB of additional disk space will be used. |
| + | Preconfiguring packages ... |
| + | Selecting previously unselected package openvpn. |
| + | (Reading database ... 109259 files and directories currently installed.) |
| + | Preparing to unpack .../openvpn_2.4.7-1ubuntu2.20.04.2_amd64.deb ... |
| + | Unpacking openvpn (2.4.7-1ubuntu2.20.04.2) ... |
| + | Setting up openvpn (2.4.7-1ubuntu2.20.04.2) ... |
| + | * Restarting virtual private network daemon. [ OK ] |
| + | Created symlink /etc/systemd/system/multi-user.target.wants/openvpn.service → /lib/systemd/system/openvpn.service. |
| + | Processing triggers for man-db (2.9.1-1) ... |
| + | Processing triggers for systemd (245.4-4ubuntu3.7) ... |
| + | |
| + | init-pki complete; you may now create a CA or requests. |
| + | Your newly created PKI dir is: /etc/openvpn/server/easy-rsa/pki |
| + | |
| + | |
| + | Using SSL: openssl OpenSSL 1.1.1f 31 Mar 2020 |
| + | Generating RSA private key, 2048 bit long modulus (2 primes) |
| + | ......+++++ |
| + | ...................+++++ |
| + | e is 65537 (0x010001) |
| + | |
| + | Using SSL: openssl OpenSSL 1.1.1f 31 Mar 2020 |
| + | Generating a RSA private key |
| + | ..........................................................................................................................................+++++ |
| + | ....+++++ |
| + | writing new private key to '/etc/openvpn/server/easy-rsa/pki/easy-rsa-2749.6tj7Mb/tmp.fSqcnR' |
| + | ----- |
| + | Using configuration from /etc/openvpn/server/easy-rsa/pki/easy-rsa-2749.6tj7Mb/tmp.TS5dnM |
| + | Check that the request matches the signature |
| + | Signature ok |
| + | The Subject's Distinguished Name is as follows |
| + | commonName :ASN.1 12:'server' |
| + | Certificate is to be certified until Jul 10 05:27:40 2031 GMT (3650 days) |
| + | |
| + | Write out database with 1 new entries |
| + | Data Base Updated |
| + | |
| + | Using SSL: openssl OpenSSL 1.1.1f 31 Mar 2020 |
| + | Generating a RSA private key |
| + | ............................+++++ |
| + | ..............+++++ |
| + | writing new private key to '/etc/openvpn/server/easy-rsa/pki/easy-rsa-2824.Fx4J3A/tmp.tlGKns' |
| + | ----- |
| + | Using configuration from /etc/openvpn/server/easy-rsa/pki/easy-rsa-2824.Fx4J3A/tmp.dVVyTl |
| + | Check that the request matches the signature |
| + | Signature ok |
| + | The Subject's Distinguished Name is as follows |
| + | commonName :ASN.1 12:'client' |
| + | Certificate is to be certified until Jul 10 05:27:40 2031 GMT (3650 days) |
| + | |
| + | Write out database with 1 new entries |
| + | Data Base Updated |
| + | |
| + | Using SSL: openssl OpenSSL 1.1.1f 31 Mar 2020 |
| + | Using configuration from /etc/openvpn/server/easy-rsa/pki/easy-rsa-2880.kL0wa3/tmp.uyyWGn |
| + | |
| + | An updated CRL has been created. |
| + | CRL file: /etc/openvpn/server/easy-rsa/pki/crl.pem |
| + | |
| + | |
| + | Created symlink /etc/systemd/system/multi-user.target.wants/openvpn-iptables.service → /etc/systemd/system/openvpn-iptables.service. |
| + | Created symlink /etc/systemd/system/multi-user.target.wants/openvpn-server@server.service → /lib/systemd/system/openvpn-server@.service. |
| + | |
| + | Finished! |
| + | |
| + | The client configuration is available in: /root/client.ovpn |
| + | New clients can be added by running this script again. |
| | | |
| *You can run it again to add/remove users or completely uninstall OpenVPN | | *You can run it again to add/remove users or completely uninstall OpenVPN |