I am setting up a database and for that I want to use a webinterface. I do not want that interface to be accessible from the WAN. Is there a way to make a VPN that I use to first login to the server that gives me access to the webinterface?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
3 answers

Hi @davidSenseIT,

Yes, there is a good way to do it. You’ll need to set up the VPN and then block all access to your interface except your VPN’s IP address. Firstly, you’ll need to configure your VPN, I’ll recommend using OpenVPN. DigitalOcean has a pretty good tutorial on how to actually configure it and use it afterward:

https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-18-04

OpenVPN is a full-featured, open-source Secure Socket Layer (SSL) VPN solution that accommodates a wide range of configurations. In this tutorial, you will set up an OpenVPN server on an Ubuntu 18.04 server and then configure access to it from Windows, macOS, iOS and/or Android. This tutorial will keep the installation and configuration steps as simple as possible for each of these setups.

Once you’ve done it, then you can go ahead and disable the access for your application, except of course the IP of your newly configured VPN.

Regards,
KDSys

by Mark Drake
OpenVPN is a full-featured, open-source Secure Socket Layer (SSL) VPN solution that accommodates a wide range of configurations. In this tutorial, you will set up an OpenVPN server on an Ubuntu 18.04 server and then configure access to it from Windows, OS X, iOS and/or Android devices. This tutorial will keep the installation and configuration steps as simple as possible for each of these setups.

I did it this way. But it was a lot of work. I also got recommended to simply put a firewall rule for that port just for requests from your machine. Not as safe probably. But you could turn it on and off every time you used it.
But I am happy with my VPN solution now when it is in place.
Thank you.

If there is somebody else looking at this I also needed to add a firewall rule to get access to my private website from the VPN.

sudo ufw allow in on tun0 to any port 5000

5000 need to be changed to the port you use.

Submit an Answer