server:openvpn
Differences
This shows you the differences between two versions of the page.
| server:openvpn [2020/02/02 14:54] – created lucid | server:openvpn [2020/02/02 14:58] (current) – removed lucid | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ======OpenVPN on Ubuntu 16.04====== | ||
| - | This guide is pretty much a copy paste of the guide by [[https:// | ||
| - | [[https:// | ||
| - | =====Step 1: Install OpenVPN===== | ||
| - | Install OpenVPN and Easy-RSA. How to use ChaCha20 FIXME | ||
| - | |||
| - | < | ||
| - | sudo apt-get update | ||
| - | sudo apt-get install openvpn easy-rsa | ||
| - | </ | ||
| - | |||
| - | =====Step 2: Set Up the CA Directory===== | ||
| - | OpenVPN is an TLS/SSL VPN. This means that it utilizes certificates in order to encrypt traffic between the server and clients. In order to issue trusted certificates, | ||
| - | |||
| - | To begin, we can copy the '' | ||
| - | < | ||
| - | make-cadir ~/ | ||
| - | </ | ||
| - | |||
| - | Move into the newly created directory to being configuring the CA: | ||
| - | |||
| - | < | ||
| - | cd ~/ | ||
| - | </ | ||
| - | |||
| - | =====Step 3: Configure the CA Variables===== | ||
| - | To configure the values our CA will use, we need to edit the '' | ||
| - | |||
| - | < | ||
| - | nano vars | ||
| - | </ | ||
| - | |||
| - | Inside, you will find some variables that can be adjusted to determine how your certificates will be created. We only need to worry about a few of these. | ||
| - | |||
| - | Towards the bottom of the file, find the settings that set field defaults for new certificates. It should look something like this:\\ | ||
| - | \\ | ||
| - | **~/ | ||
| - | |||
| - | < | ||
| - | . . . | ||
| - | |||
| - | export KEY_COUNTRY=" | ||
| - | export KEY_PROVINCE=" | ||
| - | export KEY_CITY=" | ||
| - | export KEY_ORG=" | ||
| - | export KEY_EMAIL=" | ||
| - | export KEY_OU=" | ||
| - | |||
| - | . . . | ||
| - | </ | ||
| - | |||
| - | Edit the values in red to whatever you'd prefer, but do not leave them blank:\\ | ||
| - | \\ | ||
| - | **~/ | ||
| - | |||
| - | < | ||
| - | . . . | ||
| - | |||
| - | export KEY_COUNTRY=" | ||
| - | export KEY_PROVINCE=" | ||
| - | export KEY_CITY=" | ||
| - | export KEY_ORG=" | ||
| - | export KEY_EMAIL=" | ||
| - | export KEY_OU=" | ||
| - | |||
| - | . . . | ||
| - | </ | ||
| - | |||
| - | While we are here, we will also edit the '' | ||
| - | \\ | ||
| - | **~/ | ||
| - | |||
| - | < | ||
| - | export KEY_NAME=" | ||
| - | </ | ||
| - | When you are finished, save and close the file. | ||
| - | |||
| - | =====Step 4: Build the Certificate Authority===== | ||
| - | Now, we can use the variables we set and the '' | ||
| - | |||
| - | Ensure you are in your CA directory, and then source the vars file you just edited: | ||
| - | |||
| - | < | ||
| - | cd ~/ | ||
| - | source vars | ||
| - | </ | ||
| - | |||
| - | You should see the following if it was sourced correctly: | ||
| - | |||
| - | < | ||
| - | Output | ||
| - | NOTE: If you run ./ | ||
| - | </ | ||
| - | |||
| - | Make sure we're operating in a clean environment by typing: | ||
| - | |||
| - | < | ||
| - | ./clean-all | ||
| - | </ | ||
| - | |||
| - | Now, we can build out root CA by typing: | ||
| - | |||
| - | < | ||
| - | ./build-ca | ||
| - | </ | ||
| - | |||
| - | This will initiate the process of creating the root certificate authority key and certificate. Since we filled out the vars file, all of the values should be populated automatically. Just press **ENTER** through the prompts to confirm the selections: | ||
| - | |||
| - | < | ||
| - | Output | ||
| - | Generating a 2048 bit RSA private key | ||
| - | ..........................................................................................+++ | ||
| - | ...............................+++ | ||
| - | writing new private key to '' | ||
| - | ----- | ||
| - | You are about to be asked to enter information that will be incorporated | ||
| - | into your certificate request. | ||
| - | What you are about to enter is what is called a Distinguished Name or a DN. | ||
| - | There are quite a few fields but you can leave some blank | ||
| - | For some fields there will be a default value, | ||
| - | If you enter ' | ||
| - | ----- | ||
| - | Country Name (2 letter code) [US]: | ||
| - | State or Province Name (full name) [NY]: | ||
| - | Locality Name (eg, city) [New York City]: | ||
| - | Organization Name (eg, company) [DigitalOcean]: | ||
| - | Organizational Unit Name (eg, section) [Community]: | ||
| - | Common Name (eg, your name or your server' | ||
| - | Name [server]: | ||
| - | Email Address [admin@email.com]: | ||
| - | </ | ||
| - | |||
| - | We now have a CA that can be used to create the rest of the files we need. | ||
| - | |||
| - | =====Step 5: Create the Server Certificate, | ||
| - | Next, we will generate our server certificate and key pair, as well as some additional files used during the encryption process. | ||
| - | \\ | ||
| - | Start by generating the OpenVPN server certificate and key pair. We can do this by typing: | ||
| - | |||
| - | > | ||
| - | |||
| - | < | ||
| - | ./ | ||
| - | </ | ||
| - | |||
| - | Once again, the prompts will have default values based on the argument we just passed in ('' | ||
| - | \\ | ||
| - | Feel free to accept the default values by pressing **ENTER**. Do //not// enter a challenge password for this setup. Towards the end, you will have to enter **y** to two questions to sign and commit the certificate: | ||
| - | |||
| - | < | ||
| - | Output | ||
| - | . . . | ||
| - | |||
| - | Certificate is to be certified until May 1 17:51:16 2026 GMT (3650 days) | ||
| - | Sign the certificate? | ||
| - | |||
| - | |||
| - | 1 out of 1 certificate requests certified, commit? [y/n]y | ||
| - | Write out database with 1 new entries | ||
| - | Data Base Updated | ||
| - | </ | ||
| - | |||
| - | Next, we'll generate a few other items. We can generate a strong Diffie-Hellman keys to use during key exchange by typing: | ||
| - | |||
| - | < | ||
| - | ./build-dh | ||
| - | </ | ||
| - | |||
| - | This might take a few minutes to complete. | ||
| - | \\ | ||
| - | Afterwards, we can generate an HMAC signature to strengthen the server' | ||
| - | |||
| - | < | ||
| - | openvpn --genkey --secret keys/ta.key | ||
| - | </ | ||
| - | |||
| - | =====Step 6: Generate a Client Certificate and Key Pair===== | ||
| - | Next, we can generate a client certificate and key pair. Although this can be done on the client machine and then signed by the server/CA for security purposes, for this guide we will generate the signed key on the server for the sake of simplicity. | ||
| - | \\ | ||
| - | We will generate a single client key/ | ||
| - | \\ | ||
| - | Because you may come back to this step at a later time, we'll re-source the '' | ||
| - | \\ | ||
| - | To produce credentials without a password, to aid in automated connections, | ||
| - | |||
| - | < | ||
| - | cd ~/ | ||
| - | source vars | ||
| - | ./build-key client1 | ||
| - | </ | ||
| - | |||
| - | If instead, you wish to create a password-protected set of credentials, | ||
| - | |||
| - | < | ||
| - | cd ~/ | ||
| - | source vars | ||
| - | ./ | ||
| - | </ | ||
| - | |||
| - | Again, the defaults should be populated, so you can just hit **ENTER** to continue. Leave the challenge password blank and make sure to enter **y** for the prompts that ask whether to sign and commit the certificate. | ||
| - | |||
| - | =====Step 7: Configure the OpenVPN Service===== | ||
| - | |||
| - | Next, we can begin configuring the OpenVPN service using the credentials and files we've generated. | ||
| - | Copy the Files to the OpenVPN Directory | ||
| - | |||
| - | To begin, we need to copy the files we need to the ''/ | ||
| - | |||
| - | We can start with all of the files that we just generated. These were placed within the '' | ||
| - | |||
| - | < | ||
| - | cd ~/ | ||
| - | sudo cp ca.crt server.crt server.key ta.key dh2048.pem / | ||
| - | </ | ||
| - | |||
| - | Next, we need to copy and unzip a sample OpenVPN configuration file into configuration directory so that we can use it as a basis for our setup: | ||
| - | |||
| - | < | ||
| - | gunzip -c / | ||
| - | </ | ||
| - | |||
| - | Adjust the OpenVPN Configuration | ||
| - | |||
| - | Now that our files are in place, we can modify the server configuration file: | ||
| - | |||
| - | < | ||
| - | sudo nano / | ||
| - | </ | ||
| - | |||
| - | Basic Configuration | ||
| - | |||
| - | First, find the HMAC section by looking for the '' | ||
| - | \\ | ||
| - | **/ | ||
| - | |||
| - | < | ||
| - | tls-auth ta.key 0 # This file is secret | ||
| - | key-direction 0 | ||
| - | </ | ||
| - | |||
| - | Next, find the section on cryptographic ciphers by looking for the commented out ' | ||
| - | \\ | ||
| - | **/ | ||
| - | |||
| - | < | ||
| - | cipher AES-128-CBC | ||
| - | </ | ||
| - | Below this, add an auth line to select the HMAC message digest algorithm. For this, SHA256 is a good choice:\\ | ||
| - | \\ | ||
| - | **/ | ||
| - | |||
| - | < | ||
| - | auth SHA256 | ||
| - | </ | ||
| - | |||
| - | Finally, find the user and group settings and remove the ";" | ||
| - | \\ | ||
| - | **/ | ||
| - | |||
| - | < | ||
| - | user nobody | ||
| - | group nogroup | ||
| - | </ | ||
| - | |||
| - | ====(Optional) Push DNS Changes to Redirect All Traffic Through the VPN==== | ||
| - | |||
| - | The settings above will create the VPN connection between the two machines, but will not force any connections to use the tunnel. If you wish to use the VPN to route all of your traffic, you will likely want to push the DNS settings to the client computers. | ||
| - | |||
| - | You can do this, uncomment a few directives that will configure client machines to redirect all web traffic through the VPN. Find the '' | ||
| - | \\ | ||
| - | **/ | ||
| - | |||
| - | < | ||
| - | push " | ||
| - | </ | ||
| - | |||
| - | Just below this, find the '' | ||
| - | \\ | ||
| - | **/ | ||
| - | |||
| - | < | ||
| - | push " | ||
| - | push " | ||
| - | </ | ||
| - | |||
| - | This should assist clients in reconfiguring their DNS settings to use the VPN tunnel for as the default gateway. | ||
| - | ====(Optional) Adjust the Port and Protocol==== | ||
| - | |||
| - | By default, the OpenVPN server uses port 1194 and the UDP protocol to accept client connections. If you need to use a different port because of restrictive network environments that your clients might be in, you can change the '' | ||
| - | \\ | ||
| - | **/ | ||
| - | |||
| - | < | ||
| - | # Optional! | ||
| - | port 443 | ||
| - | </ | ||
| - | |||
| - | Often if the protocol will be restricted to that port as well. If so, change proto from UDP to TCP:\\ | ||
| - | \\ | ||
| - | **/ | ||
| - | |||
| - | < | ||
| - | # Optional! | ||
| - | proto tcp | ||
| - | </ | ||
| - | |||
| - | If you have no need to use a different port, it is best to leave these two settings as their default. | ||
| - | ====(Optional) Point to Non-Default Credentials==== | ||
| - | |||
| - | If you selected a different name during the ./ | ||
| - | \\ | ||
| - | **/ | ||
| - | |||
| - | < | ||
| - | cert server.crt | ||
| - | key server.key | ||
| - | </ | ||
| - | |||
| - | When you are finished, save and close the file. | ||
| - | |||
| - | =====Step 8: Adjust the Server Networking Configuration===== | ||
| - | |||
| - | Next, we need to adjust some aspects of the server' | ||
| - | ====Allow IP Forwarding==== | ||
| - | |||
| - | First, we need to allow the server to forward traffic. This is fairly essential to the functionality we want our VPN server to provide. | ||
| - | |||
| - | We can adjust this setting by modifying the ''/ | ||
| - | |||
| - | < | ||
| - | sudo nano / | ||
| - | </ | ||
| - | |||
| - | Inside, look for the line that sets '' | ||
| - | \\ | ||
| - | **/ | ||
| - | |||
| - | < | ||
| - | net.ipv4.ip_forward=1 | ||
| - | </ | ||
| - | |||
| - | Save and close the file when you are finished. | ||
| - | |||
| - | To read the file and adjust the values for the current session, type: | ||
| - | |||
| - | < | ||
| - | sudo sysctl -p | ||
| - | </ | ||
| - | |||
| - | ====Adjust the UFW Rules to Masquerade Client Connections==== | ||
| - | |||
| - | If you followed the Ubuntu 16.04 initial server setup guide in the prerequisites, | ||
| - | |||
| - | Before we open the firewall configuration file to add masquerading, | ||
| - | |||
| - | < | ||
| - | ip route | grep default | ||
| - | </ | ||
| - | |||
| - | Your public interface should follow the word " | ||
| - | |||
| - | < | ||
| - | Output | ||
| - | default via 203.0.113.1 dev wlp11s0 | ||
| - | </ | ||
| - | |||
| - | When you have the interface associated with your default route, open the ''/ | ||
| - | |||
| - | < | ||
| - | sudo nano / | ||
| - | </ | ||
| - | |||
| - | This file handles configuration that should be put into place before the conventional UFW rules are loaded. Towards the top of the file, add the highlighted lines below. This will set the default policy for the '' | ||
| - | |||
| - | > | ||
| - | \\ | ||
| - | **/ | ||
| - | |||
| - | < | ||
| - | # | ||
| - | # rules.before | ||
| - | # | ||
| - | # Rules that should be run before the ufw command line added rules. Custom | ||
| - | # rules should be added to one of these chains: | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | |||
| - | # START OPENVPN RULES | ||
| - | # NAT table rules | ||
| - | *nat | ||
| - | : | ||
| - | # Allow traffic from OpenVPN client to wlp11s0 (change to the interface you discovered!) | ||
| - | -A POSTROUTING -s 10.8.0.0/8 -o wlp11s0 -j MASQUERADE | ||
| - | COMMIT | ||
| - | # END OPENVPN RULES | ||
| - | |||
| - | # Don't delete these required lines, otherwise there will be errors | ||
| - | *filter | ||
| - | . . . | ||
| - | </ | ||
| - | |||
| - | Save and close the file when you are finished. | ||
| - | |||
| - | We need to tell UFW to allow forwarded packets by default as well. To do this, we will open the ''/ | ||
| - | |||
| - | < | ||
| - | sudo nano / | ||
| - | </ | ||
| - | |||
| - | Inside, find the '' | ||
| - | \\ | ||
| - | **/ | ||
| - | |||
| - | < | ||
| - | DEFAULT_FORWARD_POLICY=" | ||
| - | </ | ||
| - | |||
| - | Save and close the file when you are finished. | ||
| - | |||
| - | ====Open the OpenVPN Port and Enable the Changes==== | ||
| - | |||
| - | Next, we'll adjust the firewall itself to allow traffic to OpenVPN. | ||
| - | |||
| - | If you did not change the port and protocol in the ''/ | ||
| - | |||
| - | We'll also add the SSH port in case you forgot to add it when following the prerequisite tutorial: | ||
| - | |||
| - | < | ||
| - | sudo ufw allow 1194/udp | ||
| - | sudo ufw allow OpenSSH | ||
| - | </ | ||
| - | |||
| - | Now, we can disable and re-enable UFW to load the changes from all of the files we've modified: | ||
| - | |||
| - | < | ||
| - | sudo ufw disable | ||
| - | sudo ufw enable | ||
| - | </ | ||
| - | |||
| - | Our server is now configured to correctly handle OpenVPN traffic. | ||
| - | |||
| - | =====Step 9: Start and Enable the OpenVPN Service===== | ||
| - | We're finally ready to start the OpenVPN service on our server. We can do this using systemd. | ||
| - | |||
| - | We need to start the OpenVPN server by specifying our configuration file name as an instance variable after the systemd unit file name. Our configuration file for our server is called ''/ | ||
| - | |||
| - | < | ||
| - | sudo systemctl start openvpn@server | ||
| - | </ | ||
| - | |||
| - | Double-check that the service has started successfully by typing: | ||
| - | |||
| - | < | ||
| - | sudo systemctl status openvpn@server | ||
| - | </ | ||
| - | |||
| - | If everything went well, your output should look something that looks like this: | ||
| - | |||
| - | < | ||
| - | Output | ||
| - | ● openvpn@server.service - OpenVPN connection to server | ||
| - | | ||
| - | | ||
| - | Docs: man: | ||
| - | | ||
| - | | ||
| - | Process: 5852 ExecStart=/ | ||
| - | Main PID: 5856 (openvpn) | ||
| - | Tasks: 1 (limit: 512) | ||
| - | | ||
| - | | ||
| - | |||
| - | May 03 15:30:05 openvpn2 ovpn-server[5856]: | ||
| - | May 03 15:30:05 openvpn2 ovpn-server[5856]: | ||
| - | May 03 15:30:05 openvpn2 ovpn-server[5856]: | ||
| - | May 03 15:30:05 openvpn2 ovpn-server[5856]: | ||
| - | May 03 15:30:05 openvpn2 ovpn-server[5856]: | ||
| - | May 03 15:30:05 openvpn2 ovpn-server[5856]: | ||
| - | May 03 15:30:05 openvpn2 ovpn-server[5856]: | ||
| - | May 03 15:30:05 openvpn2 ovpn-server[5856]: | ||
| - | May 03 15:30:05 openvpn2 ovpn-server[5856]: | ||
| - | May 03 15:30:05 openvpn2 ovpn-server[5856]: | ||
| - | </ | ||
| - | |||
| - | You can also check that the OpenVPN '' | ||
| - | |||
| - | < | ||
| - | ip addr show tun0 | ||
| - | </ | ||
| - | |||
| - | You should see a configured interface: | ||
| - | |||
| - | < | ||
| - | Output | ||
| - | 4: tun0: < | ||
| - | link/ | ||
| - | inet 10.8.0.1 peer 10.8.0.2/32 scope global tun0 | ||
| - | | ||
| - | </ | ||
| - | |||
| - | If everything went well, enable the service so that it starts automatically at boot: | ||
| - | |||
| - | < | ||
| - | sudo systemctl enable openvpn@server | ||
| - | </ | ||
| - | |||
| - | =====Step 10: Create Client Configuration Infrastructure===== | ||
| - | |||
| - | Next, we need to set up a system that will allow us to create client configuration files easily. | ||
| - | |||
| - | ====Creating the Client Config Directory Structure==== | ||
| - | |||
| - | Create a directory structure within your home directory to store the files: | ||
| - | |||
| - | < | ||
| - | mkdir -p ~/ | ||
| - | </ | ||
| - | |||
| - | Since our client configuration files will have the client keys embedded, we should lock down permissions on our inner directory: | ||
| - | |||
| - | < | ||
| - | chmod 700 ~/ | ||
| - | </ | ||
| - | |||
| - | ====Creating a Base Configuration==== | ||
| - | |||
| - | Next, let's copy an example client configuration into our directory to use as our base configuration: | ||
| - | |||
| - | < | ||
| - | cp / | ||
| - | </ | ||
| - | |||
| - | Open this new file in your text editor: | ||
| - | |||
| - | < | ||
| - | nano ~/ | ||
| - | </ | ||
| - | |||
| - | Inside, we need to make a few adjustments. | ||
| - | |||
| - | First, locate the '' | ||
| - | \\ | ||
| - | **~/ | ||
| - | |||
| - | < | ||
| - | . . . | ||
| - | # The hostname/IP and port of the server. | ||
| - | # You can have multiple remote entries | ||
| - | # to load balance between the servers. | ||
| - | remote server_IP_address 1194 | ||
| - | . . . | ||
| - | </ | ||
| - | |||
| - | Be sure that the protocol matches the value you are using in the server configuration: | ||
| - | \\ | ||
| - | **~/ | ||
| - | |||
| - | < | ||
| - | proto udp | ||
| - | </ | ||
| - | |||
| - | Next, uncomment the '' | ||
| - | \\ | ||
| - | **~/ | ||
| - | |||
| - | < | ||
| - | # Downgrade privileges after initialization (non-Windows only) | ||
| - | user nobody | ||
| - | group nogroup | ||
| - | </ | ||
| - | |||
| - | Find the directives that set the '' | ||
| - | \\ | ||
| - | **~/ | ||
| - | |||
| - | < | ||
| - | # SSL/TLS parms. | ||
| - | # See the server config file for more | ||
| - | # description. | ||
| - | # a separate .crt/.key file pair | ||
| - | # for each client. | ||
| - | # file can be used for all clients. | ||
| - | #ca ca.crt | ||
| - | #cert client.crt | ||
| - | #key client.key | ||
| - | </ | ||
| - | |||
| - | Mirror the '' | ||
| - | \\ | ||
| - | **~/ | ||
| - | |||
| - | < | ||
| - | cipher AES-128-CBC | ||
| - | auth SHA256 | ||
| - | </ | ||
| - | |||
| - | Next, add the '' | ||
| - | \\ | ||
| - | **~/ | ||
| - | |||
| - | < | ||
| - | key-direction 1 | ||
| - | </ | ||
| - | |||
| - | Finally, add a few **commented out** lines. We want to include these with every config, but should only enable them for Linux clients that ship with a ''/ | ||
| - | \\ | ||
| - | **~/ | ||
| - | |||
| - | < | ||
| - | # script-security 2 | ||
| - | # up / | ||
| - | # down / | ||
| - | </ | ||
| - | |||
| - | If your client is running Linux and has an ''/ | ||
| - | |||
| - | Save the file when you are finished. | ||
| - | |||
| - | ====Creating a Configuration Generation Script==== | ||
| - | |||
| - | Next, we will create a simple script to compile our base configuration with the relevant certificate, | ||
| - | |||
| - | Create and open a file called '' | ||
| - | |||
| - | < | ||
| - | nano ~/ | ||
| - | </ | ||
| - | |||
| - | Inside, paste the following script:\\ | ||
| - | \\ | ||
| - | **~/ | ||
| - | |||
| - | < | ||
| - | #!/bin/bash | ||
| - | |||
| - | # First argument: Client identifier | ||
| - | |||
| - | KEY_DIR=~/ | ||
| - | OUTPUT_DIR=~/ | ||
| - | BASE_CONFIG=~/ | ||
| - | |||
| - | cat ${BASE_CONFIG} \ | ||
| - | <(echo -e '< | ||
| - | ${KEY_DIR}/ | ||
| - | <(echo -e '</ | ||
| - | ${KEY_DIR}/ | ||
| - | <(echo -e '</ | ||
| - | ${KEY_DIR}/ | ||
| - | <(echo -e '</ | ||
| - | ${KEY_DIR}/ | ||
| - | <(echo -e '</ | ||
| - | > ${OUTPUT_DIR}/ | ||
| - | </ | ||
| - | |||
| - | Save and close the file when you are finished. | ||
| - | |||
| - | Mark the file as executable by typing: | ||
| - | |||
| - | < | ||
| - | chmod 700 ~/ | ||
| - | </ | ||
| - | |||
| - | =====Step 11: Generate Client Configurations===== | ||
| - | |||
| - | Now, we can easily generate client configuration files. | ||
| - | |||
| - | If you followed along with the guide, you created a client certificate and key called '' | ||
| - | |||
| - | < | ||
| - | cd ~/ | ||
| - | ./ | ||
| - | </ | ||
| - | |||
| - | If everything went well, we should have a '' | ||
| - | |||
| - | < | ||
| - | ls ~/ | ||
| - | </ | ||
| - | |||
| - | < | ||
| - | Output | ||
| - | client1.ovpn | ||
| - | </ | ||
| - | |||
| - | ====Transferring Configuration to Client Devices==== | ||
| - | |||
| - | We need to transfer the client configuration file to the relevant device. For instance, this could be your local computer or a mobile device. | ||
| - | |||
| - | While the exact applications used to accomplish this transfer will depend on your choice and device' | ||
| - | |||
| - | Here is an example SFTP command using our client1.ovpn example. This command can be run from your local computer (OS X or Linux). It places the '' | ||
| - | |||
| - | < | ||
| - | sftp sammy@openvpn_server_ip: | ||
| - | </ | ||
| - | |||
| - | =====Step 12: Install the Client Configuration===== | ||
| - | Installation should be relatively straightforward on any OS. Consider consulting the documentation for your own OS if you have trouble figuring it out on your own. [[https:// | ||
| - | |||
| - | Add guide on how to make it start at boot time on Linux FIXME | ||
| - | |||
| - | ======Revoking Client Certificates====== | ||
| - | Occasionally, | ||
| - | |||
| - | To do so, enter your CA directory and re-source the vars file: | ||
| - | |||
| - | < | ||
| - | cd ~/ | ||
| - | source vars | ||
| - | </ | ||
| - | |||
| - | Next, call the '' | ||
| - | |||
| - | < | ||
| - | ./ | ||
| - | </ | ||
| - | |||
| - | This will show some output, ending in error 23. This is normal and the process should have successfully generated the necessary revocation information, | ||
| - | |||
| - | Transfer this file to the ''/ | ||
| - | |||
| - | < | ||
| - | sudo cp ~/ | ||
| - | </ | ||
| - | |||
| - | Next, open the OpenVPN server configuration file: | ||
| - | |||
| - | < | ||
| - | sudo nano / | ||
| - | </ | ||
| - | |||
| - | At the bottom of the file, add the crl-verify option, so that the OpenVPN server checks the certificate revocation list that we've created each time a connection attempt is made:\\ | ||
| - | \\ | ||
| - | **/ | ||
| - | |||
| - | < | ||
| - | crl-verify crl.pem | ||
| - | </ | ||
| - | |||
| - | Save and close the file. | ||
| - | |||
| - | Finally, restart OpenVPN to implement the certificate revocation: | ||
| - | |||
| - | sudo systemctl restart openvpn@server | ||
| - | |||
| - | The client should now longer be able to successfully connect to the server using the old credential. | ||
| - | |||
| - | To revoke additional clients, follow this process: | ||
| - | |||
| - | - Generate a new certificate revocation list by sourcing the vars file in the ~/ | ||
| - | - Copy the new certificate revocation list to the / | ||
| - | - Restart the OpenVPN service. | ||
| - | |||
| - | This process can be used to revoke any certificates that you've previously issued for your server. | ||
server/openvpn.1580655290.txt.gz · Last modified: 2021/06/18 16:36 (external edit)