我将dropbear作为SSH守护进程运行在Debian (实际上是Raspbian)上。我试着设置
# /etc/hosts.allow
dropbear:192.168.1.1
# my static ip from which I SSH connect to the device和
# /etc/hosts.deny
ALL:ALL
# block all others然后我重新启动了整个设备。我仍然可以从不同的IP地址,甚至从远程进入设备SSH。是配置文件错误了,还是dropbear不支持这两个文件?
发布于 2014-05-13 00:52:17
/etc/hosts.allow和/etc/hosts.deny不包括任何支持。这些文件是由TCP包装器库(libwrap)管理的,该库不使用该库。一些第三方包补丁下拉列表用于TCP包装器支持,但不是Debian。
您可以通过tcpd启动Dropbear以获得TCP包装支持。
/usr/sbin/tcpd /usr/sbin/dropbear -i如果您只想通过IP地址进行筛选,则可以使用iptables进行筛选。
iptables -A INPUT -p tcp ! --dport 22 -j DROP发布于 2014-05-12 19:35:44
尝试:
# /etc/hosts.deny
sshd:ALL:spawn /bin/echo the ip %h tried to access `/bin/date`>> /var/log/ssh.log和
# /etc/hosts.allow
sshd:192.168.1.1如果不工作,用这种方法再试一次。
# /etc/hosts.deny
dropear:ALL:spawn /bin/echo the ip %h tried to access `/bin/date`>> /var/log/ssh.log和
# /etc/hosts.allow
dropbear:192.168.1.1并检查dropbear是否支持tcp/wrappers。
ldd /path/to/dropbear查找libwrap.so.0→/lib/libwrap.so.0
https://unix.stackexchange.com/questions/129092
复制相似问题