我正在尝试使用 TCP 包装器拒绝计算机上的特定用户 在/etc/hosts.deny 中有
sshd:tom@192.168.48.184
当我使用用户 tom 从 192.168.48.184 进行 ssh 时,它会通过,我错过了一些东西吗?
最佳答案
vi/etc/ssh/sshd_config
插入一行:
DenyUsers 用户名1 用户名2 用户名3 用户名4
引用#man sshd_config:
DenyUsers
separated by spaces. Login is disallowed for user names that
match one of the patterns. â*â and â?â can be used as wildcards
in the patterns. Only user names are valid; a numerical user ID
is not recognized. By default, login is allowed for all users.
If the pattern takes the form USER@HOST then USER and HOST are
separately checked, restricting logins to particular users from
particular hosts.
保存并重新启动 SSH 服务。
/etc/init.d/sshd 重新启动
了解更多:http://linuxpoison.blogspot.in/2008/08/how-to-deny-ssh-access-for-certain-user.html#ixzz2gjLPH8yH
感谢和问候,
阿洛克·塞克
关于linux - TCP 包装器拒绝用户@主机名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19173556/