I did experience when my “naughty” ISP injected a javascript into a web page when the site was not using https. That script was intended to track, and maybe steal some cookies (I’m not sure, since they can get anything).
And another story: when I was using public wifi while working in a cafe/coworking space, I got an SSL warning that there was a man-in-the-middle trying to intercept my connection, and it said the SSL certificate was not valid. I was shocked that it is not hard for a sysadmin to intercept our connection when they have access to the router.
The solution to this issue is to encrypt your connection with VPN (Virtual Private Network). It adds an extra security layer to your connection, and it’s proven to avoid man-in-the-middle attacks.
Requirements
- A VPS server — I recommend Vultr or DigitalOcean. They both have a $5/mo plan. Choose Ubuntu, Debian, or CentOS.
- Knowledge of how to use the Linux command line
Steps to install OpenVPN
1. Get your Ubuntu, Debian, or CentOS server ready and running.
2. SSH into your server with root access.
3. Run this script:
wget https://git.io/vpn -O openvpn-install.sh && bash openvpn-install.sh
4. Once it ends, you can run it again to add more users, remove some of them, or even completely uninstall OpenVPN.
5. Check if your OpenVPN is running and using UDP port 1194. Run this to check the service status:
systemctl status openvpn.service
And to check it is using the correct port:
netstat -plunt
6. You will have an .ovpn file in your root home directory. Download it to your local machine.
7. Congratulations — you now have an OpenVPN server running.
OpenVPN client
- On Mac, I’m using Tunnelblick — it’s free software for OpenVPN.
- On Windows and Linux, you can use Pritunl Client — it’s free and open source.
- On Android, you can use OpenVPN for Android.
- On iOS, you can use OpenVPN Connect.
Once you have the OpenVPN client set up, add your VPN settings using your .ovpn key. You can test your connection by visiting whatismyipaddress.com.
And that’s it — always secure your connection with VPN.
