A very detailed guide on how to setup VPN on Kali Linux and Ubuntu

Step 4: Connect to PIA VPN

Click Network Manager > VPN Connections > PrivateInternetAccess VPN

You will see a yellowish colored connection indicator while connecting.

Setup VPN on Kali Linux and Ubuntu - blackMORE Ops - 8

Setting up VPN on Ubuntu

Ubuntu parts were taken from PIA support site. This also covers Linux Mint or any Ubuntu variants.

This is almost as easy as it gets. There’s 3 variations you can try to connect to PIA

  1. Use PIA script for Ubuntu 12.04 or higher
  2. Setup manually via Network Manager for Ubuntu 12.04 or higher
  3. Setup manually via Network Manager for Ubuntu 10.10

Ubuntu 1 : Ubuntu Linux 12.04: OpenVPN Installer

  1. Download the openvpn ubuntu installer
  2. Run sudo sh ~/Downloads/install_ubuntu.sh (replace path to installer accordingly)
  3. Type ‘y’ to install python 2.7 in case it’s not installed.
  4. Type ‘y’ to install network-manager-openvpn in case it’s not installed.
  5. Enter the login for your account.
  6. Wait for the installation to finish.
  7. Connect using the Network Manager.
  8. Enter your password when prompted (only needs to be done once per region).

Ubuntu 2: Ubuntu Linux 12.04: OpenVPN via Network Manager Setup

  1. Open a Terminal, and run: sudo apt-get install openvpn network-manager-openvpn network-manager-openvpn-gnome. This will prompt for both your password, and a Y/n answer, please provide it with your password, and Y
  2. Once installed, open System Settings, then Network
  3. Press the + symbol to add a new connection, and select the VPN Interface, then press Create
  4. Choose OpenVPN as your VPN Connection Type, and press Create
  5. The following will walk you though all configuration steps needed for the PIA VPN.
    1. Gateway: Select one of the Hostnames provided on the Network page
    2. Authentication
      1. Type: Password
      2. Username: The username provided with the PIA account
      3. Password: The password provided with the PIA account
      4. CA Certificate: Downloaded this zip file and extract the ca.crt file to somewhere it won’t be deleted. We suggest your Home folder. If you extract this to your home folder, when searching for it, please click on your username on the left side, which will take you right to the home folder, then select the ca.crt file from the options on the right.
    3. Advanced: Under the general tab, check the Use LZO data compression
    4. IPv4 Settings:
      1. Method: Automatic (VPN) Addresses Only
  6. Press Save. If you chose to have your password saved it may ask for you to verify your password to open your keyring.

Ubuntu 3: Ubuntu Linux 10.10: OpenVPN Setup

  1. In Terminal, install openvpn packages with sudo apt-get install network-manager-openvpn.
  2. Restart the network manager with sudo restart network-manager
  3. Run sudo wget https://www.privateinternetaccess.com/openvpn/openvpn.zip
  4. Extract the files from the zip with unzip openvpn.zip.
  5. Move ca.crt and crl.pem to /etc/openvpn
  6. Open the Network Manager on the menu bar.
  7. Choose add and select the OpenVPN connection type, and click Create.
  8. Enter Private Internet Access SSL for the Connection Name.
  9. Enter us-california.privateinternetaccess.com [*] for the Gateway
  10. Select Password and enter your login credentials.
  11. Browse and select the CA Certificat we saved in Step 3.
  12. Choose Advanced and enable LZO Compression.
  13. Apply and exit.
  14. Connect using the Network Manager.

Testing: Leak Test Sites

Once connected, you would like to head the following websites to confirm if you are leaking any informations

  1. For DNS Leak test, check here:
    http://dnsleak.com/
  2. For Email leak test, check here:
    http://emailipleak.com/
  3. Those who uses ipv6, check your leaks here:
    http://ipv6leak.com/

Conclusion

VPN is good, VPN is secure, VPN allows you to bypass proxies, Firewall, monitoring and content filtering. But there’s always that drama when you’re using VPN, it sometime is slow and sometime is not that secure you’d think. But for countries like Iran, Pakistan, Egypt, China, North Korea etc. where content filtering is done in National Level maybe it’s a way to get the voice out. I am not going to discuss legality here, so I will leave that to you.

Did I make any mistakes? Let me know. You can also tell me about your setup in comments section and I will be happy to include them in this guide or a new one.

Enjoy your PrivateInternetAccess VPN. Thanks again for reading my lengthy posts! Please share and RT.

Check Also

Enabling AMD GPU for Hashcat on Kali Linux: A Quick Guide

Enabling AMD GPU for Hashcat on Kali Linux: A Quick Guide

If you’ve encountered an issue where Hashcat initially only recognizes your CPU and not the …

Boot Ubuntu Server 22.04 LTS from USB SSD on Raspberry Pi 4

Boot Ubuntu Server 22.04 LTS from USB SSD on Raspberry Pi 4

This is a guide for configuring Raspberry Pi4 to boot Ubuntu from external USB SSD …

66 comments

  1. I am from Pakistan :) I done all steps but when I connect to VPN it always shows message failed to connect to VPN and I try different Gateways like Canada, UK and US but failed to connect :(

    • Did you try to connect from Ubuntu? Unless your ISP is blocking VPN actively, there’s little reason why this should not work in Kali/Ubuntu/Debian/Linux Mint. You could also setup an Ubuntu VM within Kali and then VPN from there.

      • I am trying from Kali Linux. May be ISP is blocking but it is easier on windows to use Cyber Ghost type software for VPN.
        Ubuntu VM why?

  2. waiting for solution ;)

  3. i have installed tor is that enough or i should install VPN too ?
    can i use both of them ?

  4. Do I need a paid subscription to OpenVPN for this to work?

  5. How do I know my PIA name and PIA password? (PIA – Private internet access)

    I followed the directions but get this message. I was unsure of what to use for a PIA name, I used my Linux User Name and just made up a password. I am guessing this is not correct. I found nothing in the OpenVPN files to tell me a name or password.

    VPN connection failed.

    The VPN connection “PrivateInternetAccess VPN” failed because of invalid VPN secrets.

  6. I figured it out at the openVPN website. You have to buy a license for $9.60. That doesn’t sound bad, but you have to buy a minimum of 10. That is $96.00 when you only need one license. How much privacy do you need and what is it worth to you.

  7. Sorry, the is $96.00 a year

  8. In this article you describe the setup of VPN on Linux. While surfing on internet i found another article on the topic of How to setup VPN on MAC at VpnRanks. I want to know your point of view about this article. Thanks in advance.

  9. I’ve followed your guide, yet am unable to connect to the PIA VPN. I click on the Network Manager select the VPN and nothing happens. In System Settings under Network, the VPN is set to “off” and when but won’t stay switched to “on”. Is there a way to force the connection to stay on or use the VPN? It works on windows but doesn’t work on Kali, on either my HD install or in a VM on windows. 40 a year isn’t a bad deal but when it only works on one OS install and nothing else is a bit frustrating. Any ideas?

  10. Has anyone been able to use port 443 (host) for outbound connections? Everytime I force the host port within the kali network manager (Advanced tab: custom gateway port) my pia fails to connect. Any suggestions? thanks.

  11. What is the gateway of openvpn for India

  12. One important thing you didn’t cover in this post is does the VPN provider offer a client that locks internet access so that if the connection is lost with the VPN server, you’re not exposed.

  13. thank you for your tutorials – I’ve used them extensively and have found them to be very complete and a great help! I used this and got my PIA set up in minutes. Thanks again!

  14. No candidate version found for network-manager-openvpn-gnome
    No candidate version found for network-manager-pptp
    No candidate version found for network-manager-pptp-gnome
    No candidate version found for network-manager-strongswan
    No candidate version found for network-manager-vpnc
    No candidate version found for network-manager-vpnc-gnome
    No candidate version found for network-manager-openvpn-gnome
    No candidate version found for network-manager-pptp
    No candidate version found for network-manager-pptp-gnome
    No candidate version found for network-manager-strongswan
    No candidate version found for network-manager-vpnc
    No candidate version found for network-manager-vpnc-gnome
    No packages will be installed, upgraded, or removed.
    0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    Need to get 0 B of archives. After unpacking 0 B will be used.

    All i get is this message when I try to install

    • is your kali repository ok? check /etc/apt/source.list and if the source list does not contain the kali repository then add the repositories first. u can jst google kali repository and u’ll get the help from kali official website. there are also post for adding kali repository on both 1.x kali as well as kali 2.0 in this site too..

  15. crap….spoke to soon. Isn’t my ip address supposed to be obsecured now? Cause it’s not. FML

  16. IDK what i did wrong but now my network interface is no more available :3

    http://prntscr.com/7wlbv9

    Can someone help me :3

    Everything was perfect i did managed to configure pia vpn but when i was trying to connect to the vpn nothing was happening so i tried

    https://forums.kali.org/showthread.php?18597-OpenVPN-connection-won-t-start-through-Network-Manager

    elfer’s method at that time i was able to see the network interface but after i reboot it;s been gone :3

    • BlackMore, I can’t get these intructions to work with Kali2.0 – would you mind looking into this.

      I get the following error when following the PIA VPN guide (https://www.privateinternetaccess.com/pages/client-support/ubuntu-openvpn):

      Package network-manager-openvpn is required for installation. Aborting..

      And I get this error when following your guide:

      apt-get install network-manager-openvpn

      Reading package lists… Done
      Building dependency tree
      Reading state information… Done
      Package network-manager-openvpn is not available, but is referred to by another package.
      This may mean that the package is missing, has been obsoleted, or
      is only available from another source

      E: Package ‘network-manager-openvpn’ has no installation candidate

      Thanks for the help

  17. I am from Pakistan I install openvpn in kali linux 2.0 and it is not connecting

  18. Maybe iVPN could also be great for Kali Linux. https://www.ivpn.net/why-ivpn

  19. strongswan package seem to be disappeared any new commands??????????

  20. how do i configure vpn on kali linux 2.0

  21. in Kali 2.0 i can’t get a VPN tab in network settings. so no the same as earlier kali versions.

    • You can get a VPN tab by pressing the little + sign in the bottom left corner in the network settings then click “OpenVPN” I have gotten it setup but I can’t get it to connect is all.

  22. the link (https://www.privateinternetaccess.com/openvpn/openvpn.zip) is censored in my contry…how can I do?

  23. Thank you blackmoreops. You have made my Kali boot into the command line instead of the gui. I would enjoy some help

  24. hey guys!
    i run kali linux on virtual box on windows 7 and i use cyberghost 5 as a vpn on windows, can this make me anonymous while i use tools on kali?

  25. Getting
    Gnutls:Error in the pull function.
    Unable to establish SSL connection.
    What shud I do knw???

  26. When i enter this command:
    aptitude -r install network-manager-openvpn-gnome network-manager-pptp network-manager-pptp-gnome network-manager-strongswan network-manager-vpnc network-manager-vpnc-gnome

    This is what i get:
    No candidate version found for network-manager-openvpn-gnome
    No candidate version found for network-manager-pptp
    No candidate version found for network-manager-pptp-gnome
    Couldn’t find any package whose name or description matched “network-manager-strongswan”
    No candidate version found for network-manager-vpnc
    No candidate version found for network-manager-vpnc-gnome
    No candidate version found for network-manager-openvpn-gnome
    No candidate version found for network-manager-pptp
    No candidate version found for network-manager-pptp-gnome
    Couldn’t find any package whose name or description matched “network-manager-strongswan”
    No candidate version found for network-manager-vpnc
    No candidate version found for network-manager-vpnc-gnome
    No packages will be installed, upgraded, or removed.
    0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    Need to get 0 B of archives. After unpacking 0 B will be used.

  27. hi i don’t know how setup the password and user name ?? help please :)

  28. Hey, maybe thats a stupid question, but i cant find how to connect in auto way to my vpn?
    I used Kali 2.0, i wrote few vpn configuration in my gnome network manager but i dont have a cross or case to check to select one for autostart.
    Its a little bit annoying, for exemple, i dont see if one VPN server fall down, ive nothing to say me “HEY im down, your not secure anymore”.
    Just have to watch on the right up corner to check if im still safe. Nice, when you’re working to check all the time.

    If you have any advice, thanks again for your work.
    DpL

  29. Appreciate this article and aiming for a similar setup. How would you suggest ensuring that the VPN is used by default with Ubuntu/Kali VMs, and that network access is denied without a PIA path up and running via VPN? tia

  30. I downloaded openvpn files from the above link but when i ran them from the terminal by using command “openvpn –config …” it is asking for username and password.

  31. Good article. Installing network manager, using Kali 3.20.2

    apt-get install network-manager-openvpn-gnome

    works.

  32. when i enter this command :
    aptitude -r install network-manager-openvpn-gnome network-manager-pptp network-manager-pptp-gnome network-manager-strongswan network-manager-vpnc network-manager-vpnc-gnome
    error is coming :
    bash: aptitude: command not found
    what is the reason behind this error ?please help!!

    • It sounds like you don’t have aptitude installed…try:

      sudo apt-get install aptitude

      This should fix the error for most but if your OS is not up to date try running:

      sudo apt-get update
      sudo apt-get upgrade

      And then running the “sudo apt-get install aptitude” again. After aptitude is installed you should have no problem running the command in your initial comment.

  33. root@kali:/home/jeff# aptitude -r install network-manager-openvpn-gnome network-manager-pptp network-manager-pptp-gnome network-manager-strongswan network-manager-vpnc network-manager-vpnc-gnome
    bash: aptitude: command not found

    unable to download

  34. I wonder why nobody want to talk about “what is the username and password for this openvpn” here.. even the article above or the comments also.. nobody answer the question about what is the username and password.. So what is thePIA username and PIA password?Any web site to register account??

  35. Thanks blackmoreops.

    BTW if someone is only looking for accessing region restricted services and not doing some heavy things, you can use vpnbook instead of PIA. vpnbook is free and serves the purpose.

  36. Great article. I’m dealing with some of these issues as well..

  37. Great tutorial indeed. Still, if you want a vpn service that is plug and play, get Astrill.

  38. Idd great tutorial.

    I gonna give it a try very soon.

    On the usb 3.0 stick with Kali 2.0 I have running Tor also an recently I have installed the Opera browser, it has a VPN and it’s running very fast.

  39. tor + vpn is good for more anonymity

  40. fuck… Just download vpnbook and use it… username, password given on download page.

    #SM

  41. Thanks for the entire information regarding how to setup VPN on Kali Linux and Ubuntu. This is really helpful!

  42. my only question is where do i get the pia id pass?.. -.- asking bcoz tired of searching

Leave your solution or comment to help others.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from blackMORE Ops

Subscribe now to keep reading and get access to the full archive.

Continue reading