Setting up OpenVPN under Debian - how it works
With just a few simple steps, you have set up OpenVPN under Debian and can surf safely. Read this practical tip to find out exactly how to do this.
Setting up OpenVPN on Debian - you have to do that
- Before you get started, you should use "apt-get update" and "apt-get upgrade" to make sure that your system is up to date. With the help of "apt-get install openvpn" OpenVPN is then downloaded and installed.
- Then change to the directory of OpenVPN with "cd / usr / share / doc / openvpn / examples / sample-config-files /".
- Copy the sample configuration into your directory with "cp server.conf.gz / etc / openvpn /".
- Then change to your directory with "cd / etc / openvpn /" to unpack the configuration with "gunzip server.conf.gz".
- Then copy the required certificates with the command "cp -r /usr/share/doc/openvpn/examples/easy-rsa/2.0 easy-rsa2".
- Go back to the OpenVPN folder with "cd / etc / openvpn / easy-rsa2" and create the "Keys" folder with the "mkdir keys" command. In future, all certificates and keys will be saved there.
- To use OpenSSL, you should copy the existing configuration file with "cp openssl-1.0.0.cnf openssl.cnf".
- Now change to the directory "/ etc / openvpn / easy-rsa2 / vars" by entering the command "cd / etc / openvpn / easy-rsa2 / vars". Open the file with "vim vars".
- Adjust the file so that it looks something like this: export KEY_COUNTRY = "DE" export KEY_PROVINCE = "BY" export KEY_CITY = "Ismaning" export KEY_ORG = "JiffyBox VPN" export KEY_EMAIL = " ". Change your data so that it fits.
- With the help of "source ./vars" the changes are saved and adapted to the current variables.
- Then enter "./build-ca" to create the security certificate. There you have to confirm the data with [Enter].
- Then you have to create the server certificate with "./build-key-server". Confirm by pressing the [Y] key twice.
- You create the key for the client with "./build-key". Again, you have to confirm [Y] twice.
- If you want to create a secure connection, enter the command "./build-dh".
- As a last step, adjust the server configuration with your data with "vim /etc/openvpn/server.conf" and make sure that all data is correct.
- Now you can start OpenVPN with "service openvpn start".
In the next practical tip, we will show you how to set up OpenVPN under Linux.