PDA

View Full Version : Restrict SSH to IP



userdan
06-22-09, 00:32
Hello. Can one set it so that SSH access is restricted to just my IP or IP range? Call me paranoid, but I don't want to take the risk of someone else logging in to my server if they somehow manage to get a hold of my SSH login details.

surreality
06-22-09, 06:16
I think you can use iptables to block other IP addresses from accessing your server through SSH. I'm not sure of the actual method, though. Perhaps someone else here knows more about it.

Amelia
06-22-09, 07:00
Hello. Can one set it so that SSH access is restricted to just my IP or IP range? Call me paranoid, but I don't want to take the risk of someone else logging in to my server if they somehow manage to get a hold of my SSH login details.

Yes that can be done. You can allow/restrict IP's using hosts.allow and hosts.deny file.

/etc/hosts.allow
/etc/hos.deny

If you are not sure on how to do this, you can contact your hosting provider.