0

What is the correct way to set up a VPN and then only allowing SSH from that VPN? I want to set this up to remove my SSH from the open internet and only allow access via a dedicated VPN connection, I'm just not 100% sure how to implement everything.

4
  • What steps have you taken so far?
    – Revulai
    Aug 21 '15 at 21:26
  • So far I have verified that I need to remove SSH from the open internet, and need to only allow connections through said VPN. I'm not really 100% sure where to start, so I came here to get some advice in how to start said implementation. Thanks for the comment!
    – user84051
    Aug 21 '15 at 21:28
  • I guess the good start would be chroot, if you want to ban all the other unix tools.
    – Jakuje
    Aug 21 '15 at 22:00
  • What sort of VPN? OpenVPN? IPSec? Something else?
    – MadHatter
    Aug 22 '15 at 14:47
2

edit sshd_config located in /etc/ssh/sshd_config and add this line at the bottom :

AllowUsers root@YOUR_VPN_IP

This allows you to log in to SSH as the root user from your IP. Don't forget to restart ssh service :

service sshd restart
0

Or set up iptables rules to allow inbound ssh only over VPN interface/IP and deny in other if's.

Your Answer

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