为了测试它,我将这四行添加到我的/etc/hosts.deny
文件中:
# /etc/hosts.deny
ssh-agent:ALL
sshd:ALL
Run Code Online (Sandbox Code Playgroud)
我等了一段时间,然后尝试通过 ssh 访问环回 IP 地址。但我仍然得到这个:
$ ssh root@localhost
Password: ?
Run Code Online (Sandbox Code Playgroud)
我可以访问它。我什至尝试添加明确拒绝从 127.0.0.1 访问的条目。