Sunday, 3 January 2016

Ubuntu Server and Open VPN Client

I've got VPN access as part of mu newshosting package and thought it was about time I made use of it to anonymyise my online activities.

I don't want to run it on the whole network just on one machine that does downloading and indexing and so on, this machine does not have a GUI so it's all going to be setup by command line and I want it to run on startup.

If you want newsgroup access then I find NewsDemon among the best:


They give you access to SlickVPN as part of some of their packages, so lets get started on how to get this all setup.
Once you have your account activated, you're going to need to download an .ovpn file, in the case of SlickVPN you can get it here.

Save the link to your machine and then we need to install open vpn, it's quite straightforward, just ssh into the machine and type:

sudo apt-get install openvpn

Now you need to move the .ovpn file to the /etc/openvpn folder and rename it, in my case I used the following

sudo mv SV_mobile.ovpn /etc/openvpn/myvpn.conf

You then need to create a file containing the username and password for your VPN connection with:

sudo nano /etc/openvpn/details.txt

In this we need just two lines

vpnusername
vpnpassword

Save it and then we need to edit the myvpn.conf file with:

sudo nano /etc/openvpn/myvpn.conf

At the end of the line that says auth-user-pass we just add details.txt so that it looks like this:
auth-user-pass details.txt

Save the file and then there's one more to edit:

sudo nano /etc/default/openvpn

Uncomment AUTOSTART="all"

Save the changes and you should be able to start up the VPN connection with:

sudo service openvpn start

Type ifconfig and you should see an extra network adaptor called tun0

route -n should also show some extra entries, restart the machine to make sure that the VPN starts up on boot.