我在hosts.deny中有这个内容(最后有一个新行):
#
# hosts.deny This file describes the names of the hosts which are
# *not* allowed to use the local INET services, as decided
# by the '/usr/sbin/tcpd' server.
#
# The portmap line is redundant, but it is left to remind you that
# the new secure portmap uses hosts.deny and hosts.allow. In particular
# you should know that NFS uses portmap!
sshd : ALL这在hosts.allow中是:
#
# hosts.allow This file describes the names of the hosts which are
# allowed to use the local INET services, as decided
# by the '/usr/sbin/tcpd' server.
#
sshd: our.ip.add.ress: allow然后,我们执行这段代码来重新启动SSH:
/etc/init.d/sshd restart
再一次,这是一个新的路线在最后。但是,我们仍然可以从另一个服务器访问SSH服务并尝试登录。我们做错什么了?
发布于 2011-12-31 12:02:43
您的/etc/hosts.deny,我认为您有语法错误。在"sshd“和冒号之间不应该有空格。因此,应改为:
sshd: ALL在“允许”方面,我有这样的台词:
sshd: 192.168.1.1在IP地址之后没有尾随文本。
发布于 2011-12-31 12:03:29
您不需要: allow in hosts.allow。它应该是这样的:
sshd: 192.168.2.200如果您拥有控制台访问权限,您可以尝试阻止使用tcpwrappers的所有内容,以防服务名称出现问题:
hosts.deny:
ALL: ALLhosts.allow:
ALL: 192.168.2.200发布于 2012-01-01 01:03:54
值得检查的是,对的支持实际上已经编译到您正在使用的sshd中吗?
根据O‘’reilly蜗牛书,它需要使用-withlib包装物或- with包装选项中的任何一个进行编译。
(我不确定大多数发行版是否默认启用了它,或者open的默认编译时选项是什么)。
我刚才检查过我的:
ldd /usr/sbin/sshd | egrep 'wrap'这表明
libwrap.so.0 => /lib64/libwrap.so.0 (0x00002ba50fa9c000)(h/t至这个堆栈交换问题)
https://serverfault.com/questions/345558
复制相似问题