xshell-ssh连接服务器意外中断(Disconnected from remote host)


还是第一次出现这个问题。

使用last命令

root     pts/3        112.41.50.242    Mon Jan 15 08:22   still logged in
root     pts/2        112.41.50.242    Mon Jan 15 08:16   still logged in
root     pts/1        112.41.50.242    Mon Jan 15 08:14   still logged in
root     pts/3        112.41.50.209    Sat Jan 13 23:43 - 00:45 (1+01:02)
root     pts/2        112.41.50.209    Sat Jan 13 23:41 - 00:45 (1+01:04)
root     pts/1        112.41.50.209    Sat Jan 13 23:39 - 00:45 (1+01:06)

有可能是网络ip地址变化导致xshell自动断开连接,修改本机ip为固定地址即可。

还可能是本机网络dns变化导致xshell自动断开连接,修改ssh配置文件将其中“UseDNS yes”去掉注释并改成no即可,过程如下。

vim /etc/ssh/sshd_config
...
#ClientAliveInterval 0
#ClientAliveCountMax 3
#ShowPatchLevel no
UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
...

重启系统即可。

参考

http://blog.csdn.net/iamoldpan/article/details/77595624

http://blog.csdn.net/baidu_19473529/article/details/52870244

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM