OpenVPN Sertup on Ubuntu Server 18.04 and connecting from Kubuntu (or any Ubuntu Flavor) Links In Article
For this guide I’ll assume you already have Ubuntu server installed. I’ll make another video that covers Ubuntu server installation, but for now I don’t have that video.
Step 1) SSH into your server using terminal with ssh email@example.com
Step 2) Add a user. It’s never a good idea to leave your root user as the primary user. To add a new user use the command adduser steve (you can choose any username I just choose Steve because that’s my name and it’s handy.) Enter a password, it won’t show on screen that you’re typing so just trust you’re typing what you think you’re typing, you still have to confirm the password by typing it in again anyway. Fill in the user details if you care, but for now it doesn’t matter if you don’t.
Step 3) Give your new user some superuser privileges. This is done with the command usermod – aG sudo steve now let’s logout using the command logout
Step 4) SSH back into your server using your new user so in my case that would look like ssh firstname.lastname@example.org enter your new password and you should be in.
Step 5) Update. This is pretty standard practice. Use sudo apt-get update && sudo apt-get upgrade – y this is going to refresh your software repositories and install the upgrades it finds.
Step 6) Install OpenVPN. I like to use a script provided by Angristan, a GitHub user. The command we need is wget https://raw.githubusercontent.com/Angristan/OpenVPN-install/master/openvpn-install.sh
This just downloads the script. Make the script executable with sudo chmod +x openvpn-install.sh
Step 7) execute the script using sudo ./openvpn-install.sh and follow the steps. It’s going to ask your servers ip address, whether you prefer udp or tdp, and the strength of your encryption. For the most part you can use the default suggested entry as the script grabs the info for you. The last step asks for your certificate name, just name it something logical like “hp Laptop-Steve” or something. The certificate will be stored in the root of your user’s home directory.
Now OpenVPN is installed. Contracts!
Step 8) Use FTP to connect to your server and download the certificate. At this point we’ve done very little to setup our server for remote management, but that’s okay because OpemSSH, which we’ve used for our ssh, also works for sftp (secure file transfer protocol) so in your favorite ftp software enter your server op address xxx.xxx.xxx.xxx your user (same one we created at the beginning) steve, your password and specify port 22. Locate your certificate, it should end with the extension .ovpn
Now your server is setup and you have the certificate.
Check the video to see how to import the key into Ubuntu network manager (in the case of the video I’m using Kubuntu 18.04) however I will make followup articles to show how to use this certificate in Windows, Ubuntu (standard flavor), and MacOS. For Android you can download the OpenVPN app
Happy surfing! If you broke something leave a comment and let me know what happened, I’ll see if I can find a fix and or update the article.
OpenVPN Install Script from Angristan on GitHub https://github.com/Angristan/OpenVPN-install