Search

Thursday, October 04, 2012

How to restrict ssh login by ip address

SSH restriction can be accomplished in below two files.

1.    /etc/hosts.allow

Example:
sshd: 1.2.3.0/255.255.255.0  sshd: 192.168.0.0/255.255.255.0

2.    /etc/hosts.deny

Example:
sshd: ALL

The access control software consults the above two files.   Search stops at the first match.

No comments:

Post a Comment