Every day millions of people uses different VPN service providers to protect their online privacy. But it not all VPN providers are as anonymous or as secured or dedicated to protecting your Online privacy as they claim to be. Some VPN service providers even log your activity and if you are living in a country where certain sites are not allowed or you might get prosecuted for doing something as simple as scanning a network (yes, it’s in-fact an offense in many First World countries). I wrote this article on fixing VPN grayed out problem in Kali Linux. Many readers asked me to write a complete guide on how to set up VPN and which ones are secured.
Fact is, I simply cannot test all VPN providers. I cannot vouch for other users experiences and I usually only write stuffs I am sure about. Of many VPN providers, PrivateInternetAccess is claimed to be the best and fastest and according to their ToS and Privacy Policy, they seems to be well praised and recommended by several reviews such as done by TorrentFreak and LifeHacker. I strongly suggest readers to do some research before committing to any providers.
Following eight questions were taken from TF website and I feel that you should be asking yourself the same questions before going for any VPN providers: (I’ve added some comments below, your opinion might be different).
- Do you keep ANY logs which would allow you to match an IP-address and a time stamp to a user of your service? If so, exactly what information do you hold and for how long?
- No logs.
- Under what jurisdictions does your company operate and under what exact circumstances will you share the information you hold with a 3rd party?
- Out of US, GB or any NATO affiliated countries if possible. But then you compromise on speed. Alternatively suspend user account instead of handing over logs or data.
- What tools are used to monitor and mitigate abuse of your service?
- Other than abuse blocking and service uptime, no monitor at all.
- In the event you receive a DMCA takedown notice or European equivalent, how are these handled?
- Suspend user account instead of handing over logs or data.
- What steps are taken when a valid court order requires your company to identify an active user of your service?
- Suspend user account instead of handing over logs or data.
- Is BitTorrent and other file-sharing traffic allowed on all servers? If not, why?
- I never cared for BT, but I guess no discrimination on any type of traffic.
- Which payment systems do you use and how are these linked to individual user accounts?
- Anything and everything. Best would be BitCoin. Setup own BTminer and pay with that. In that way, little/no online trace whatever.
- What is the most secure VPN connection and encryption algorithm you would recommend to your users?
- AES-128, RSA2048 or higher supported. Don’t use SHA1.
As I mostly use Kali Linux, my primary concentration would be on that. However, Kali Linux and Ubuntu uses same Network Manager, so this guide applies to the any Debian variant such as Kali Linux, and Ubuntu variants such as Linux Mint etc. In short, if you follow this guide, you will be able to setup VPN on Kali Linux, Ubuntu, Debian Linux Mint etc.
Setup VPN on Kali Linux
I use Kali Linux despite many of it’s flaw and shortcomings and I have became used to it. If you’re seriously about Online privacy, stick with the distro you know and understand best. Kali is just another Linux distro and it is as secured as you make it. There are many ways you can do it. VPN to Tor to VPN via anon proxy.
Why use VPN – benefits?
Here’s my top 11 reasons why you would want to use VPN services.
- VPN provides Privacy and cloaks your IP address.
- Use any network (public or private or free WiFi) with encryption
- Login to your home or Work network from anywhere with confidence.
- Bypass censorship and content monitoring.
- Browse and bypass Firewall and censorship policy at work or Anywhere!
- Access region restricted services from anywhere (i.e. Youtube videos, NetFlix or BBC Player etc.)
- Transfer or receive files with privacy.
- Hide your voice/VOIP calls.
- Use Search Engines while hiding some of your identity.
- Hide yourself
- Cause you like to be anonymous.
As you can see from the list above, VPN not necessarily hides everything. Search engines can probably still recognizes you based on your cookies, previous browsing behavior, account sign-in (duh!), browser plug-ins (i.e. Alexa, Google Toolbar etc.).
Step 1: Enabling VPN on Kali Linux
By default the VPN section is grayed out on Kali Linux. You can follow my guide on fixing VPN grayed out issue (with screengrabs) or just copy paste the commands from below:
There’s two variants on the commands I’ve used, the first one enables all sorts of VPN and PPTP mumbo-junbo’s so that you don’t have to work your way through it later.
root@kali:~# aptitude -r install network-manager-openvpn-gnome network-manager-pptp network-manager-pptp-gnome network-manager-strongswan network-manager-vpnc network-manager-vpnc-gnome
The second one is more specific to VPN and just enabling VPN
root@kali:~# apt-get install network-manager-openvpn
On some cases, you might have to restart network-manager and networking,
root@kali:~# service networking restart [....] Running /etc/init.d/networking restart is deprecated because it may not r[warnble some interfaces ... (warning). [ ok ] Reconfiguring network interfaces...done. root@kali:~# root@kali:~# service network-manager restart [ ok ] Stopping network connection manager: NetworkManager. [ ok ] Starting network connection manager: NetworkManager. root@kali:~#
Once done, it will fix your VPN grayed out issues. For other Linux distro, this isn’t so much of a problem as those packages are usually pre-installed. (which I find a waste as your distro becomes bulkier).
Step 2: Download and extract openvpn certs from PIA
Download and extract the openvpn.zip file containing ca.crt in the correct directory:
root@kali:~# wget https://www.privateinternetaccess.com/openvpn/openvpn.zip --2015-02-27 13:14:14-- https://www.privateinternetaccess.com/openvpn/openvpn.zip Resolving www.privateinternetaccess.com (www.privateinternetaccess.com)... 23.215.245.45 Connecting to www.privateinternetaccess.com (www.privateinternetaccess.com)|23.215.245.45|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 8242 (8.0K) [application/zip] Saving to: `openvpn.zip' 100%[======================================>] 8,242 --.-K/s in 0s 2015-02-27 13:14:15 (149 MB/s) - `openvpn.zip' saved [8242/8242] root@kali:~# root@kali:~# unzip -q openvpn.zip -d /etc/openvpn root@kali:~#
Step 3: Configure Network Manager to use PIA VPN
Go to Network Manager > Edit Connections
Change to VPN Tab. VPN> Add
Click [ADD +] click the drop down menu, and set the type as OpenVPN.
Click [Create]
Go to “VPN” and fill up the following details”.
- Connection name:
PrivateInternetAccess VPN
- Gateway:
us-east.privateinternetaccess.com [**choose Gateway's from the list below]
- Username:
PIA Username
- Password:
PIA Password
- CA Certificate: Browse to
/etc/openvpn
and selectca.crt
- Click [Advanced]: Check the box next to “Use LZO data compression“
- Click [OK], [Save] and then [Close].
As for Gateways, choose on the following depending on your location:
PIA Regional Gateways
- United States (US VPN)
us-midwest.privateinternetaccess.com
us-east.privateinternetaccess.com
us-west.privateinternetaccess.com
us-texas.privateinternetaccess.com
us-california.privateinternetaccess.com
us-florida.privateinternetaccess.com
- Canada (CA VPN)
ca.privateinternetaccess.com
ca-toronto.privateinternetaccess.com
- United Kingdom (UK VPN)
uk-london.privateinternetaccess.com
uk-southampton.privateinternetaccess.com
- Switzerland (Swiss VPN)
swiss.privateinternetaccess.com
- Netherlands (NL VPN)
nl.privateinternetaccess.com
- Sweden (SE VPN)
sweden.privateinternetaccess.com
- France (FR VPN)
france.privateinternetaccess.com
- Germany (DE VPN)
germany.privateinternetaccess.com
- Romania (RO VPN)
ro.privateinternetaccess.com
- Hong Kong (HK VPN)
hk.privateinternetaccess.com
- Israel (Israel VPN)
israel.privateinternetaccess.com
- Australia (Australia VPN)
aus.privateinternetaccess.com
- Japan (Japan VPN)
japan.privateinternetaccess.com
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?
waiting for solution ;)
i have installed tor is that enough or i should install VPN too ?
can i use both of them ?
Yes, VPN then TOR would work. But expect slow (pre dialup!) traffic.
What is better to use for anonymity? VPN or TOR?
Do I need a paid subscription to OpenVPN for this to work?
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.
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.
Sorry, the is $96.00 a year
jymmn, you’re confusing openVPN application and VPN service.
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.
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?
Did you follow the guide on How to fix VPN grated out issue?
Yes, as I stated I followed the guide above, as well as the greyed out VPN issue. I found this information and it corrected the problem. https://forums.kali.org/showthread.php?18597-OpenVPN-connection-won-t-start-through-Network-Manager
The response by Elfer did the trick.
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.
What is the gateway of openvpn for India
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.
That mostly applies to Windows client as far I managed to test.
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!
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..
thank you a million times
crap….spoke to soon. Isn’t my ip address supposed to be obsecured now? Cause it’s not. FML
gm….got it ;) Thanks for awesome tut
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
I am from Pakistan I install openvpn in kali linux 2.0 and it is not connecting
Maybe iVPN could also be great for Kali Linux. https://www.ivpn.net/why-ivpn
strongswan package seem to be disappeared any new commands??????????
how do i configure vpn on kali linux 2.0
Exactly same way.
No, not at all. You need a .ovpn file to configure it. Nobody has baeen able to setup PIA in Kali 2
Yes i haven’t been able to set up a PIA VPN connection in kali 2 either despite a few hours effort.
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.
the link (https://www.privateinternetaccess.com/openvpn/openvpn.zip) is censored in my contry…how can I do?
Hi kakamay,
Then you need to find one that’s not censored and use that to get account/installer for a better paid one. Use this Free VPN providers of 2015. Good luck.
-BMO
I have tried with vpnbook, “internetz.me”, tor browser, but it don’t work.
Hi kakamay, this is loeken from internetz.me. If your country is censored try contacting our staff via livechat or by email ( support@internetz.me ). There are different kinds of blocks in different countries. We have some methods to bypass blocks for certain countries.
Thank you blackmoreops. You have made my Kali boot into the command line instead of the gui. I would enjoy some help
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?
Getting
Gnutls:Error in the pull function.
Unable to establish SSL connection.
What shud I do knw???
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.
Thanks, VPN works well to in kali rolling.
http://www.ironbugs.com/2016/02/anonymity-setup-vpn-service-in-kali.html
hi i don’t know how setup the password and user name ?? help please :)
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
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
I’ve just added this solution to https://askubuntu.com/questions/43465/how-to-automatically-connect-to-vpn-with-network-manager?answertab=active#tab-top and it works great. I’m running kali 2016.2.8 Rolling Distro
Here’s the correct link: http://askubuntu.com/a/801519/570982
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.
Good article. Installing network manager, using Kali 3.20.2
apt-get install network-manager-openvpn-gnome
works.
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.
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
sudo apt-get install aptitude
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??
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.
Great article. I’m dealing with some of these issues as well..
Great tutorial indeed. Still, if you want a vpn service that is plug and play, get Astrill.
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.
tor + vpn is good for more anonymity
fuck… Just download vpnbook and use it… username, password given on download page.
#SM
Thanks for the entire information regarding how to setup VPN on Kali Linux and Ubuntu. This is really helpful!
my only question is where do i get the pia id pass?.. -.- asking bcoz tired of searching