I want to use a third-party VPN service on a Amazon AWS EC2 instance, and set up NordVPN with OpenVPN.

After following the instructions in this answer I'm still not able to SSH into the instance after activating the VPN. Does the fact that the Ubuntu machine is running on EC2 require me to do anything else?

2 Answers 2


Would love to know the answer myself, but here is a hack I did.

you can run whatever inside a shell, you'll lose ssh, but it will run from the vpn.


echo "Executing Nord VPN"
nordvpn connect us5215
echo "Executing Python"
python3.8 /home/ubuntu/main.py
echo "Disconnecting VPN"
nordvpn disconnect

SSH is not lost by connecting via nordvpn's mesh network.
Mesh networking is a relatively recent addition.

$ nordvpn set meshnet on
New contributor
user537622 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.