OpenVPN on Linux Terminal

This howto describes how to use OpenVPN to connect with Perfect Privacy on the Linux terminal. These instructions should work on all Linux versions; X-Windows is not necessary. It is also assumed that you know how to install software packages like wget and unzip. If not, please consult the documentation for your package management.

Requirements and preparation

Make sure you have the following components installed:

  • wget
  • sudo with root access (or direct root access)
  • unzip
  • any text editor like vi, nano, etc.

Install OpenVPN if not already installed. This should be available in the repositories for your Linux distribution. For debian based distributions like Ubuntu or Linux Mint the command is as follows:

sudo apt-get install openvpn

Next change into the /etc/openvpn/ directory

cd /etc/openvpn/

and get the Perfect Privacy configuration with the following line. You will need to change USERNAME and PASSWORD to your Perfect Privacy login credentials.

sudo wget -v --post-data "username=USERNAME&password=PASSWORD&uri=/member/download/?" -O ""

Now unzip the downloaded file. Use -j to to put the content directly into /etc/openvpn/.

sudo unzip -j

After the archive has extracted, there is one more optional step to do if you don’t want to enter your password for every new connection. To store your password, use a text editor of your choice to create the file password.txt in the /etc/openvpn/ directory. In this example we are using vim.

sudo vim password.txt

In the textfile, enter your username and password, each in a single line, like shown on the screenshot to the left.

Now you will need to edit the server configuration file so it instructs OpenVPN to use the password.txt file for the credentials. The server configurations always have the extension .ovpn and are named after the Location. If you want to connect to, open Amsterdam.ovpn in your editor and in the line auth-user-pass add password.txt so the line reads like in the screenshot to the left.

OpenVPN is now configured and you can start a connection with the following command:

sudo openvpn /etc/openvpn/Amsterdam.ovpn

If everything went correctly, it should say “Initiation sequence complete.” at the end. You can terminate the connection by using CTRL-C. For productive usage you will probably want to run this in a screen so you can detach after the connection was established.

You can use our check IP site to verify that the OpenVPN connection was established and is working correctly:

wget -q -O -
If you have any questions, comments or other feedback regarding this howto, please use the corresponding thread in our community forums.