linux configure IP access

Allow access
vi /etc/hosts.allow
add (you can add multiple lines, which ": allow" can save rate)
sshd: 192.168.81 *:. # Represents the allow 192.168.81 * ip ssh segment can access.
Sshd: All : allow # representation allow ssh access to all the ip
sshd: 192.168.81.74: allow # representation allow access 192.168.81.74ssh

 

Access Denied
vi /etc/hosts.deny
add (you can add multiple lines, which ": deny" can save rate)
sshd: All: deny # refused access to all ip
sshd: 210.13.218 *:. Deny # refused 210.13. 218. * ip ssh access to all segments
sshd: 192.168.81.74 # refused 192.168.81.74 host ssh access

 

After editing save the file, restart the service to be effective, execute reboot command

service xinetd restart

When hosts.allow and hosts.deny configuration conflicts, to hosts.allow prevail.

Guess you like

Origin www.cnblogs.com/qize/p/12374274.html