DEV Community

meera123
meera123

Posted on

How to connect to a private instance using VPN.

In a previous blog, I explained how to connect to an instance with private IP. This blog explains how to connect to the private instance using a VPN.

step 1:
First, create an instance that does not have a public IP.
step 2:
Go to Amazon AMI->Market Place search OpenVPN and click on select->continue.

Image description

Image description

step 3:
After this configure the instance and make sure to give it a public IP.

Image description
step 4:
Then connect to the instance using the ssh client then click yes to agree on agreements and click enter to every option.

Image description
step 5:
It won't connect because we have to change the name root to openvpnas. Copy the Admin UI and Client UI to the notepad. Then connect by giving username openvpnas. Because we are trying to connect to the vpn, not the root.

Image description

Image description

step 6:
After it will get connect give the password to the vpn by providing the following commands.
sudo passwd openvpn

Image description
step 7:
After that go to notepad where you pasted the Admin UI and client UI. Again copy the Admin UI then paste it on google search. Then it will ask you for the id and password. Provide the id as OpenVPN and give the password you have created and log into that VPN. There you can manage who can access the server and other permissions.

Image description

Image description

Step 8:
After that go to openvpn website and install OpenVPN in the client's system so they also can connect to the private server.

Image description

Image description
Step 9:
After the installation, copy the client UI, paste it into the URL, and give the password you created and on the VPN so that the client can access the private server.

Image description

Image description

Image description

That's it. After these steps, both you and your clients will be able to connect to the private server.

Hope you all find it informative!!

Top comments (0)