linux ssh连接自动断开问题

场景描述:云上的虚拟机使用public ip连接ssh时,一直提示已经连接,但是就会自动关闭

1. 通过正常虚拟机作为跳板,能够连接到目标机子上,检查发现进程正常,但是就一直连接不上

[root@test]# ps aux|grep sshd
root      56924  0.0  0.0 145468  5328 ?        Ss   12:17   0:00 sshd: root@pts/6
root      58411  0.0  0.0  80876  3636 ?        Ss   14:31   0:00 /usr/sbin/sshd -D

2. 发现ssh做了访问控制,拒绝所有,只对同一网段的ip放行

[root@test]# vi /etc/hosts.allow 
[root@test]# tail -2 /etc/hosts.deny   #deny all
#
sshd:all
[root@test]# tail -2 /etc/hosts.allow  #开放
sshd:10.100.200.
sshd:public ip  --> 加上需要使用的主机

  

 

posted @ 2018-09-19 17:03  Reid21  阅读(3653)  评论(0编辑  收藏  举报