OpenVPN & Private Internet Access Setup Tutorial

Linux Command Line Setup of OpenVPN and Private Internet Access

[ source: support.privateinternetacces.com ]

  • Use the following instructions to install OpenVPN via the command line in Linux.
  • This set-up has been known to work with several unsupported versions of Linux, as well as the supported Ubuntu.
  • This worked on my machine running openSUSE LEAP 42.1.
  • You will be prompted to enter your PIA username and password after step 6; have those ready.

INSTRUCTIONS

  1. sudo apt-get install openvpn
    or sudo yum ... (on RedHat/Fedora/CentOS)
    or sudo zypper ... (on openSUSE)
  2. cd /etc/openvpn
  3. sudo wget https://www.privateinternetaccess.com/openvpn/openvpn.zip
  4. sudo unzip openvpn.zip (install 'unzip' first if needed)
  5. ls -l -- List all server config files; choose a region.
  6. sudo openvpn 'server-config-filename-goes-here.ovpn'

Store Your Username and Password and Have OpenVPN Load Them Automatically

[ source: my.hostvpn.com ]

INSTRUCTIONS

  1. cd /etc/openvpn
  2. sudo vim auth.txt
  3. Type your username on line 1, password on line 2; nothing more.
  4. Save and exit this file. (e.g. :wq in vim)
  5. sudo vim 'server-config-filename-goes-here.ovpn' -- Edit your chosen region's config file.
  6. On the line which says "auth-user-pass" append the username/password filename "auth.txt".
  7. The modified line should now read as follows: auth-user-pass auth.txt
  8. Save and exit.
  9. If you have OpenVPN running in another terminal tab halt that process with Ctrl+C.
  10. Start OpenVPN again: sudo openvpn 'server-config-filename-goes-here.ovpn'

Your VPN should now initialize without prompting you for your username/password.

  • Send feedback and/or questions to me at adam@kernelmastery.com.
  • View this gist and download the instructions from GitHub.