1) White list form
requirements: Only allow 192.168.0.11 and 192.168.0.10 login All other forbidden
implementation:
1. Vim/etc/hosts.allow//Add the following:
sshd:192.168.0.11, 192.168.0.10
2. Vim/etc/hosts.deny//Add the following:
Sshd:all
2) blacklist form
Requirements: only 192.168.0.11 Landing, all other release
/etc/hosts.allow file does not add any content
Modify:
Vim/etc/hosts.deny//Add the following:
sshd:192.168.0.11
after saving the configuration file, you can do it without restarting.
We can understand how these two files work: When the client IP landing server, first to match hosts.allow, if there is this IP, then direct release, if there is no this IP, then see Hosts.deny, If there is this IP (all including all IP) is rejected, if there is no match in Deny, it will also be released. In other words, if none of the two files have a qualified IP, they will be released!
If all two files are in aSshd:all all IP, because the system first to match hosts.allow this file.
This article is from "be doing!" "Blog, be sure to keep this provenance http://zengweidao.blog.51cto.com/8342699/1438221