|
First, Linux IP restrictions Online:
1: The directory / etc / hosts.allow to allow landing under IP configuration file, if we can limit the landing IP 192.168.0.0 network segment
Can be set to:
sshd: 192.168.0.0/255.255.255.0 (optional subnet, no not tried)
2: The directory / etc / hosts.deny as limitations under the IP configuration file, set all non-landing
sshd: all
These two configuration files for the final configuration, only the 192.168.0.0 IP network can SSH login!
Second, restrict user login:
1, modify /etc/pam.d/sshd
auth required pam_listfile.so item = user sense = allow file = / etc / sshusers onerr = fail
2, increase the user
echo "root" >> / etc / sshusers |
|
|
|