I am have set up a vpn server (openvpn) and I have a client too. I want to set it up so that a second server can only be access from the vpn server over SSH. How can I do this?


Add a firewall rule on the second server so it only accepts ssh traffic that comes from one of the addresses that the (Open)VPN server hands out.

If VPN traffic comes in on server 2 on a special interface you can also configure sshd to only listen on that.

  • I was expecting there to be more to it than just a firewall change. So would IP tables work for this instead of using something like ufw? – Josh Kirby Jun 25 '18 at 13:27
  • ufw is just a frontend for (the same system, called netfilter, as) iptables, so iptables could be used. – Henrik Jun 25 '18 at 14:28

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.