linux - TCP 包装器拒绝用户@主机名

标签 linux tcp wrapper

我正在尝试使用 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/

相关文章:

linux - 通缉 : cloud service that builds my open source project (for free? )

c - 套接字 recv() 卡在带有 MSG_WAITALL 的大消息上

java - Netty writeAndFlush() 不完整

ios - 拉取刷新插件: PullToBounce Wrapper UIScrollView

linux - 获取最顶层窗口的 pid 和详细信息

.net - 大量文件之间大量数据的最快套接字方法

c - 带有MSG_TRUNC的Linux TCP recv()-写入缓冲区?

c++ - 帮助使用 WinAPI 包装器

java - 通过设计模式重构交换机机壳的旧实例

linux - 子目录未使用 Rsync Linux 复制到远程服务器