

- #Private vpn access server install#
- #Private vpn access server password#
- #Private vpn access server download#
Going into each file to add the aforementioned settings would be too tedious, it is better to use a small script that goes into each file and adds the settings. These settings deal with changing the DNS servers in order to prevent DNS leaks when the VPN is up. We also need to add the following settings to all the configuration files. This can be accomplished by issuing the following command: sed -i 's/auth-user-pass/auth-user-pass \/etc\/openvpn\/client\/login-enabled\/login/g' *.ovpn
#Private vpn access server password#
We need to alter all the configuration files so that they can get the user name and password from a file named “login” located at “/etc/openvpn/client/login-enabled/”. Change to the directory where we stored them by issuing the following command: cd /etc/openvpn/client/confs-available/PIA

Mkdir /etc/openvpn/client/confs-available/PIAĬp *.ovpn /etc/openvpn/client/confs-available/PIA/īecause we want the OpenVPN client to start without user interaction, we need to add a couple of settings to all VPN configuration files we just downloaded. Mkdir /etc/openvpn/client/certs-available/PIAĬp *.crt /etc/openvpn/client/certs-available/PIA/Ĭp *.pem /etc/openvpn/client/certs-available/PIA/ Once the file is unzipped we can start moving the configurations to the directories we previously created.
#Private vpn access server download#
We are doing this so that in the future if there is a need to download a new set of configurations we can easily tell which directory contains the newly downloaded ones. This command will unzip the openvpn.zip file into a directory whose name starts with the date followed by “-PIA-openvpn”. Now that we have the zipped file with all the configurations we need to unzip it by using the following command: unzip openvpn.zip -d "$(date +"%d-%m-%Y")"-PIA-openvpn Once in /etc/openvpn/client/vpn-bundles we can proceed to download the configuration bundle with wget by issuing the following: wget Switch to the directory we created to store the configuration bundle by issuing the following command: cd /etc/openvpn/client/vpn-bundles We are going to download those configurations, alter them a bit and use them to connect to the PIA VPN server as soon as our system finishes booting up. Private Internet Access (as well as other VPN providers) provide configuration bundles for the OpenVPN default client. Mkdir vpn-bundles Setting up all the configurations Once there we create several directories by issuing the following commands: mkdir certs-available First we need to switch to “/etc/openvpn/client directory”. This will help if we ever need to alter the configuration by only requiring the change of a couple of linked files.

Just to keep things organized we will create a set of directories.
#Private vpn access server install#
We can do this by using the following command:Īpt -y install openvpn unzip wget curl openresolv Setting up the directory structure To accomplish this task we are going to need to install openvpn, unzip, wget, curl and openresolv. I’m sure other VPN service providers would work the same way.Īlthough I initially tested this on Raspbian Stretch on a Raspberry Pi, I have since used the same steps on Debian Stretch and achieved the same results. I’ve chosen to use Private Internet Access only because I already have an account with them and they support the OpenVPN client to connect to their VPN servers. In this howto, we will configure the OpenVPN client to connect to the VPN servers hosted by Private Internet Access. It allows you to connect to an untrusted network and tunnel all your network traffic so that it emerges from the VPN server to its destination. A Virtual Private Network establishes a secure encrypted connection between your system and a server.
