How to Setup Private Internet Access VPN for Ubuntu and Linux Mint

Virtual Private Networks (VPNs) are great to help you keep your Internet traffic secure. VPN’s do two things. First they encrypt your data so no one can tell what you are looking at. Second, VPN’s also encrypt the location of the data that you are requesting. This keeps groups from blocking access to public websites or modifying the content of the websites you are looking at. I recently purchased a VPN service from the “Private Internet Access” company for approximately $40 / year. I followed this guide install the VPN on my computer via this guide. For some reason it didn’t quite work. Perhaps because the guide was for Ubuntu 12.04 and currently I am running Linux Mint 17.2 (which runs off the same source list as Ubuntu 14.04). Here is the guide to how I installed the VPN’s.

I first followed the tutorial by getting the script that Private Internet Access has on their website and running the script:

chmod +x

This script successfully added the VPN connections under the VPN connections tab. However when I went to click on them I got an error.


The error said “The VPN connection failed because there where no valid VPN secrets.” I did some Googling and finally found a way to fix the issues. The script we ran earlier created a bunch of files in the /etc/NetworkManager/system-connections/ folder. We need to edit these files to change


and add the following lines


There are a bunch of “PIA – Location” flies in the /etc/NetworkManager/system-connections/ folder so rather than edit each one by hand I wrote a quick script to edit them. You can use the following script

Create a file with the contents of the script below

for f in /etc/NetworkManager/system-connections/PIA*;
sed -i 's/password-flags=1/password-flags=0/g' "$f"
echo "
" >> "$f"



Then make it executable with the chmod +x and run the script with a sudo.

And there we go you should be able to access your VPN.

This entry was posted in Everything Penguin Related, Uncategorized. Bookmark the permalink.

5 Responses to How to Setup Private Internet Access VPN for Ubuntu and Linux Mint

  1. Phil says:

    Thanks for this! Worked a treat for me in Linux Mint 17.2 as well 🙂

  2. protected says:

    THANKS FOR WRITING THIS UP! Made a big difference.

  3. Sam says:

    I used the linux app [] which solved the issue and also created an app to run in the task bar of Mint. so far is working okay.

  4. Jack says:

    I could kiss you. Thank you for this. Have been looking for a fix to this bug for a while now.

  5. Denise says:

    Thank you! Works on Xubuntu 14.04.4 LTS

Leave a Reply to Denise Cancel reply

Your email address will not be published. Required fields are marked *