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

linux 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  --> 加上需要使用的主机

  

 

相关文章:

  • 2021-07-07
  • 2021-12-25
  • 2021-09-21
  • 2022-01-07
  • 2021-06-02
  • 2021-12-05
  • 2021-09-30
  • 2021-12-15
猜你喜欢
  • 2021-11-21
  • 2021-11-03
  • 2021-12-17
  • 2021-11-18
  • 2021-12-02
  • 2021-11-21
  • 2021-10-07
  • 2021-04-02
相关资源
相似解决方案