我正在使用sles-12服务器,我试图限制我的服务器的ssh访问仅限于我的个人电脑。我试过使用tcpwrappers,但它不起作用!我可以从本地网络中的任何IP向服务器发送ssh。
我尝试了不同的格式从手册页,看看是否有任何工作,但没有效果。下面是我用来设置包装器和命令的文件,这些文件可能很有用
[root@myserver ~]# cat /etc/hosts.allow
sshd:172.19.112.120
[root@myserver ~]# cat /etc/hosts.deny
sshd:ALL
[root@myserver ~]# tcpdmatch -d -i /etc/xinetd.conf sshd 135.250.164.106 --> another server
client: hostname paranoid
client: address 135.250.164.106
server: process sshd
access: granted --> NOT OK
[root@myserver ~]#
[root@myserver ~]# ldd /usr/sbin/sshd | grep 'libwrap'
libwrap.so.0 => /lib64/libwrap.so.0 (0x00007fa2b71f7000)PS: IP表限制运行良好。但我不能在我的场景里用它。并且没有在/etc/ssh/ssh_config中执行特定的配置。
发布于 2018-12-14 14:31:58
事实上,我们可以在/etc/ssh/sshd_config中使用sshd_config文件来完成这个任务。
我以Allowusers admin@格式使用了参数AllowUsers,它运行得很好。我们可以根据需要增加更多的用户或IP。
https://unix.stackexchange.com/questions/485651
复制相似问题