Author Topic: How To Install and Use OpenVPN - VPNBook  (Read 7768 times)

GNULINUX

  • Guest
How To Install and Use OpenVPN - VPNBook
« on: August 10, 2016, 10:02:02 am »
How To Install and Use OpenVPN: VPNBook

This tutorial shows you how to install and use OpenVPN from the command line.
I'm using a free VPN service with no GUI/Client so everyone can test this out and hopefully learn something.
Confirmed working on Peppermint 6 & 7



How to install:

Update the package cache:
Code: [Select]
sudo apt-get updateInstall OpenVPN:
Code: [Select]
sudo apt-get install openvpn

VPN provider:

Browse to VPNBook (Free and no account needed!)
Code: [Select]
http://www.vpnbook.com/

  1 :  Click on OpenVPN



  2 :  Download a Server OpenVPN Certificate Bundle
  3 :  Save the Username and Password, you will need it later on
The password is changed every few days so check on the site if it doesn't work anymore!



  4 :  Browse to the downloaded Server OpenVPN Certificate Bundle
Right click the .zip and choose Extract Here



  5 :  You now should see a new folder with .ovpn- files in it


How to use OpenVPN from the command line:

Open a terminal and change directory to the path where the configuration (.ovpn) files are:
Code: [Select]
cd /home/user/VPN/VPNBook.com-OpenVPN-Euro1/Start OpenVPN with an .ovpn-file:
Code: [Select]
sudo openvpn vpnbook-euro1-tcp80.ovpnThe path and name of the .ovpn-file must be adjusted to your own situation!
Tip: Open a Nemo window so you can copy/paste the path and name of the .ovpn-file.

Fill in your (sudo)password and the VPNBook username and password that you have saved earlier.
The VPN should now start connecting.
Initialization Sequence Completed means that your (VPN) connection is established and ready to use!

You can disconnect the VPN connection by using the magical keyboard combination Ctrl+C   ;D

Example output:
Spoiler (click here to view / hide)
[close]




Automatic login (VPN username & VPN password): (Optional)

Tired of typing your login and password every time you use the VPN service?

Open Nemo at the location of your .ovpn-files:



  1 :  Right click on an empty space in the window and choose Create New Document - Empty Document
Name the new file auth
  2 :  Right click the auth-file and choose Open With Gedit/Pluma
Add the VPN login and the password on a different line and save the file



  3 :  Right click the .ovpn-file and choose Open With Gedit/Pluma
  4 :  Change auth-user-pass to auth-user-pass auth and save the file

You are now ready to run the VPN with the same commands as mentioned in "How to use OpenVPN from the command line".
No need to type the login and password!

Example output:
Spoiler (click here to view / hide)
[close]



Automatic VPN login and connection at boot (for every user): (Optional)

Users who always want to use their VPN can start it at boot (for every user) by following the next steps.

Follow steps 1,2,3 and 4 as described in "Automatic login (VPN username & VPN password)" and open Nemo at the location of the auth and .ovpn files.



  1 :  Right click the .ovpn-file and choose Rename...
Change the .ovpn-extension to a .conf-extension and copy the auth and .conf-file
  2 :  Open /etc/openvpn/ and right click on an empty space in it and choose Open as Root
Paste the auth and .conf-file to /etc/openvpn/

At this point RESTART your system, an OpenVPN service restart did not do the trick on my system...

Every user should now be connected to the VPN!



  3 :  You can test if it's working by typing ifconfig in the terminal, the output should show a tun3 device
Code: [Select]
ifconfig  4 :  You can also visit one of the many "What is my IP?" sites, here I used DNS leak test


If you want to stop, start or restart the VPN, use following commands:
Code: [Select]
sudo service openvpn stop
Code: [Select]
sudo service openvpn start
Code: [Select]
sudo service openvpn restartImportant Note:
If one user disables the VPN it's disabled for every user if you use a normal user switch ("Logout-Login" or "Switch User")!
You have to manually start the VPN service (or reboot the system) to get the VPN running again!



This tutorial should also work with VPN providers who have separate cert/key-files as long as you put them in the same directory as the .ovpn/.conf-file!

Useful link for checking your IP: What is my IP address?

Enjoy your Peppermint!  8)
« Last Edit: August 23, 2016, 03:37:52 pm by GNULINUX »

Offline Slim.Fatz

  • Global Moderator
  • Veteran
  • *****
  • Posts: 2377
  • Karma: 624
  • Where's the mouse?
    • View Profile
  • Peppermint version(s): Peppermint 7, 8.5 & 10 - 64bit
Re: How To Install and Use OpenVPN - VPNBook
« Reply #1 on: August 10, 2016, 10:56:46 am »
Hi GNULINUX,

Very nice tutorial !!  8) I will be trying it out as soon as I get back from a trip out of town.

Regards,

-- Slim
Respect science, respect nature, respect each other.

Tread lightly: Fluxbox, JWM, i3, Openbox, awesome

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26452
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: How To Install and Use OpenVPN - VPNBook
« Reply #2 on: August 10, 2016, 11:09:09 am »
Do you want this tunnel to auto-connect at every boot .. for all user accounts ?

if so, post the contents of the .ovpn file
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26452
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: How To Install and Use OpenVPN - VPNBook
« Reply #3 on: August 10, 2016, 04:43:11 pm »
You must first have already installed openvpn before continuing below, so if you haven't already, run
Code: [Select]
sudo apt-get install openvpnNow place the FULL:-

vpnbook-euro1-tcp80.ovpn

file (from the .zip archive) into your:-

/etc/openvpn

directory, and rename it to:-

vpnbook-euro1-tcp80.conf

now edit:
Code: [Select]
sudo pluma /etc/openvpn/vpnbook-euro1-tcp80.confand change the line:-

auth-user-pass

to:-

auth-user-pass vpnbook-auth.txt

SAVE the file and exit pluma

Now create the file
Code: [Select]
sudo pluma /etc/openvpn/vpnbook-auth.txt
and make it contain just the 2 lines from your auth file .. SAVE it and exit pluma.

now run
Code: [Select]
sudo service openvpn restartand wait a few seconds for the connection to come up

running (after a few seconds)
Code: [Select]
ifconfigshould show a tun3 device .. if not wait a few seconds longer and run it again

then going to
http://whatismyipaddress.com/
should show your IP as 176.126.237.217

Notes -

The VPN should automagically be running when you boot

You can stop it with
Code: [Select]
sudo service openvpn stopyou can start it with
Code: [Select]
sudo service openvpn startor restart it with
Code: [Select]
sudo service openvpn restartdid that lot make sense ?
« Last Edit: August 10, 2016, 05:31:58 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline Todd

  • Newly Subscribed
  • *
  • Posts: 18
  • Karma: 2
  • New Forum User
    • View Profile
  • Peppermint version(s): 7
Re: How To Install and Use OpenVPN - VPNBook
« Reply #4 on: August 10, 2016, 06:02:50 pm »
This is great. But for noobs...it's a lot to get your head around. Now I know why they create VPN services..lol
Did you guys go to school to learn coding? or is all this self taught..wow.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26452
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: How To Install and Use OpenVPN - VPNBook
« Reply #5 on: August 11, 2016, 05:22:08 am »
LOL .. I wish I was :))
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline Kyle

  • Member
  • ***
  • Posts: 140
  • Karma: 13
  • Microshaft cannot compete...
    • View Profile
  • Peppermint version(s): 7 (x64)
Re: How To Install and Use OpenVPN - VPNBook
« Reply #6 on: August 11, 2016, 06:31:07 am »
Great tutorial! But please, use caution when using free VPN services. The end user has no way of knowing if their internet activity is being logged, that is something only the provider knows.
[] Dell Latitude E6400 []
[] CPU: Intel Core 2 Duo P8600 [] RAM: 4GB DDR2 [] HDD: 1TB 5400RPM WD Black []

Offline Kyle

  • Member
  • ***
  • Posts: 140
  • Karma: 13
  • Microshaft cannot compete...
    • View Profile
  • Peppermint version(s): 7 (x64)
Re: How To Install and Use OpenVPN - VPNBook
« Reply #7 on: August 11, 2016, 06:20:53 pm »
Thanks Kyle,
You're right, VPN's (free AND paid for) are always a matter of trust!  ;)

This tutorial isn't really about VPNBook but about OpenVPN. I just needed an example VPN that was accessible for everyone. VPNBook was my choice because it's free, offers a nearly 100% up-time and uses OpenVPN. Everybody can use this tutorial to get their first VPN running (with VPNBook) and decide afterwards which VPN provider (with OpenVPN) they're going to use.

Greets!

You did the right thing, no worries. The only thing I can suggest to anyone interested in using a VPN is for them to get a VPS and set up OpenVPN on there. There are a couple OpenVPN setup scripts that require basic knowledge to use and can be installed on popular server distributions (such as Ubuntu/Debian and CentOS). Doing this allows you to have full control over your server and plus you can use the server for anything else you wish (webserver(s), gameserver(s), etc.) it's usually cheaper, too. OVH is a good provider for this.
[] Dell Latitude E6400 []
[] CPU: Intel Core 2 Duo P8600 [] RAM: 4GB DDR2 [] HDD: 1TB 5400RPM WD Black []

Offline Todd

  • Newly Subscribed
  • *
  • Posts: 18
  • Karma: 2
  • New Forum User
    • View Profile
  • Peppermint version(s): 7
Re: How To Install and Use OpenVPN - VPNBook
« Reply #8 on: August 11, 2016, 10:57:00 pm »
Hi Kyle, Not sure about doing that for myself as the server company has all your details and can be tracked back to you can't it?

I would basically want to be as anonymous as possible.. otherwise.. no point really in doing all this is there?
I would want to even use a disposable credit card or one use debit card.
I could be wrong though.

Todd
« Last Edit: August 11, 2016, 11:03:34 pm by Todd »

Offline Kyle

  • Member
  • ***
  • Posts: 140
  • Karma: 13
  • Microshaft cannot compete...
    • View Profile
  • Peppermint version(s): 7 (x64)
Re: How To Install and Use OpenVPN - VPNBook
« Reply #9 on: August 12, 2016, 06:35:23 am »
Hi Kyle, Not sure about doing that for myself as the server company has all your details and can be tracked back to you can't it?

I would basically want to be as anonymous as possible.. otherwise.. no point really in doing all this is there?
I would want to even use a disposable credit card or one use debit card.
I could be wrong though.

Todd

Complete anonymity on the Internet is impossible, it's just the way the Internet works (basic networking). It all comes down to what you are going to need to be anonymous for, if you are just doing everyday browsing, occasional downloading of torrent(s), etc. then a VPS should suffice. But if you want to achieve greater "anonymity" you could always use Tor along with a commercial VPN service (or your own, self hosted on a VPS). There is some concern that Tor may be deanonymized, and in some instances it has happened, although it has proven to be somewhat unreliable and a rare occurrence. It all depends on your threat model. I find it a good idea to use a "NAT" VPS provider (it's a shared IPv4 that you get 20 ports free to do as you wish with, and one dedicated for SSH) that is cheaper than a traditional VPS and it is much cheaper and there are likely (at least) 100+ VPS hosted behind each IP, so in a sense, it is a VPN on top of a VPN. But whether you choose to use a commercial VPN service or self host, remember to use HTTPS Everywhere, it is very important. Many sites have the option to use SSL, but don't have it accessible by default. HTTPS Everywhere, will check if there is a HTTPS version of the site you are trying to visit, if there is it will connect you to the HTTPS version. This is very important, because if the datacenter/VPN provider is logging, you will be much safer as they will not be able to get any of your information that you input on SSL websites because SSL certificates are stored in the browser. Essentially, you are just passing through already encrypted traffic back and forth to the website you are visiting.
[] Dell Latitude E6400 []
[] CPU: Intel Core 2 Duo P8600 [] RAM: 4GB DDR2 [] HDD: 1TB 5400RPM WD Black []

Offline Todd

  • Newly Subscribed
  • *
  • Posts: 18
  • Karma: 2
  • New Forum User
    • View Profile
  • Peppermint version(s): 7
Re: How To Install and Use OpenVPN - VPNBook
« Reply #10 on: August 13, 2016, 05:02:09 am »
Thanks for the comments Kyle. I suppose you are still susceptible to the VPS company/host revealing your info with a court order etc... if they get the IP etc? Or is it easy to set it up to be totally anonymous like a VPN service that does not keep logs?
I was looking at airvpn they seem to be good all round from the reviews. No logging is a biggie. Then making sure there are no DNS leaks via the UFW (firewall). Setting it all up manually without a VPN service is a bit daunting to noobies. At least for the moment anyway.
« Last Edit: August 13, 2016, 05:32:57 am by Todd »

Offline Kyle

  • Member
  • ***
  • Posts: 140
  • Karma: 13
  • Microshaft cannot compete...
    • View Profile
  • Peppermint version(s): 7 (x64)
Re: How To Install and Use OpenVPN - VPNBook
« Reply #11 on: August 13, 2016, 06:24:49 am »
Thanks for the comments Kyle. I suppose you are still susceptible to the VPS company/host revealing your info with a court order etc... if they get the IP etc? Or is it easy to set it up to be totally anonymous like a VPN service that does not keep logs?
I was looking at airvpn they seem to be good all round from the reviews. No logging is a biggie. Then making sure there are no DNS leaks via the UFW (firewall). Setting it all up manually without a VPN service is a bit daunting to noobies. At least for the moment anyway.

If you are looking to evade copyright infringement notices, going with a VPS in a country that does not have laws like the DMCA would be a must. Most of the countries in the EU are like this, with the exception of Germany (which have very tight Internet laws), also be sure to avoid UK and any other countries that have bad Internet laws. I know for a fact that OVH isn't very bothered by it's customers using their services for torrenting as many seedbox companies use OVH. There is a couple setup scripts to do this, but the one I would recommend would be from Angristan on Github. It doesn't require any  knowledge to set up, and it is very secure. It offers two settings, one with lower encryption and one with higher encryption. Usually the difference between the lower encryption setting and the higher encryption setting isn't huge, in fact, I don't notice any difference (or if there is one, it is negligible). But, if you want to go with a commercial VPN provider, be very careful because a lot of "no logs" VPN providers actually do log and they will hand over your info if needed (it is to be expected for a ~$10/mo service). This has happened a lot, even with reputable companies like HideMyA**... Also, be wary of VPN review sites because the majority of them are just SEO and they give most of the VPN services they review a good review because people sign-up through their affiliate link.
[] Dell Latitude E6400 []
[] CPU: Intel Core 2 Duo P8600 [] RAM: 4GB DDR2 [] HDD: 1TB 5400RPM WD Black []

Offline VinDSL

  • Administrator
  • Hero
  • *****
  • Posts: 5879
  • Karma: 1154
  • Team Peppermint
    • View Profile
  • Peppermint version(s): Developmental Builds
Re: How To Install and Use OpenVPN - VPNBook
« Reply #12 on: August 13, 2016, 05:34:38 pm »
From what I've heard and read about VPN service providers, it's best to find a service provider that doesn't keep log files.  Evidently, even some 'anonymous' VPS service providers (so called) maintain their own logs.

Maybe this might be helpful:  http://www.vpnnologs.com/