linux系统如何限制远程登录ip

在Linux系统上限制远程登录的IP,使用系统自带的配置文件。

/etc/hosts.allow

/etc/hosts.deny

匹配原则  先allow 后deny.

要求: 只允许 192.168.0.1 和 192.168.0.10 登陆 其他全部禁止

实现:  
1. vim   /etc/hosts.allow   //增加如下内容
sshd: 192.168.0.1, 192.168.0.10

2. vim  /etc/hosts.deny   //增加如下内容
sshd:  ALL

要求: 只限制192.168.0.1登陆上来,其他全部放行

实现: 
vim  /etc/hosts.deny   //增加如下内容
sshd: 192.168.0.1

原文地址:https://www.cnblogs.com/lin1/p/5581062.html