小编use*_*688的帖子

/etc/hosts.allow 中拒绝的 IP 地址出现在 /etc/csf/csf.deny 中吗?

我将我的/etc/hosts.allow文件修改为

sshd : 192.168.0.0/255.255.255.0 : allow
sshd : xxx.xxx.xxx.* : allow
sshd : ALL : deny
Run Code Online (Sandbox Code Playgroud)

(其中 xxx 代表我的实际 IP 地址编号,通配符 * 代表整个范围 0-255)然后重新启动 sshd 和 Apache Web 服务器。我观察了接下来的一周,因为来自外国的 IP 地址继续出现在/etc/csf/csf.deny.

116.31.116.15 # lfd: (sshd) Failed SSH login from 116.31.116.15 (CN/China/-): 5 in the last 300 secs ...
Run Code Online (Sandbox Code Playgroud)

我的期望是否正确,hosts.allow文件中被拒绝的 IP 地址甚至不应该显示登录屏幕来尝试登录,因此 csf.deny 日志中的条目证明我的 hosts.allow 文件没有做我想要的?

或者,我是否被通用错误消息 ( 5 in the last 300 secs)误导了,因为实际上这些 IP 地址实际上并没有尝试输入用户和密码 5 次?

我的目标是防止未经批准的 IP 地址甚至无法输入用户名和密码。我怎么知道我是否实现了这一目标?

当他们的 IP 实际上被拒绝时,我应该期望 …

security linux hosts.allow csf

5
推荐指数
1
解决办法
2165
查看次数

标签 统计

csf ×1

hosts.allow ×1

linux ×1

security ×1