分页: 1 / 1

怎样将SSH设置为一直连接(不断线)

发表于 : 2016-04-06 21:21
okudayukiko0
ubuntu的SSHD默认是如果客户端长时间不操作SSH就会自动断线,很麻烦。

Re: 怎样将SSH设置为一直连接(不断线)

发表于 : 2016-04-06 21:29
vickycq
检查服务器 sshd_config 的 ClientAliveInterval, TCPKeepAlive 参数
检查客户端 ssh_config 的 ServerAliveInterval, TCPKeepAlive 参数
检查所用 shell 的自动登出设置,如 bash 的 TMOUT,csh 的 autologout

参考
http://serverfault.com/questions/278396 ... -on-ubuntu
https://docs.oseems.com/general/applica ... le-timeout
http://www.cyberciti.biz/faq/appleosx-b ... ash-shell/

Re: 怎样将SSH设置为一直连接(不断线)

发表于 : 2016-04-07 13:01
rosynirvana
如果是挂代理用的,试试autossh

Re: 怎样将SSH设置为一直连接(不断线)

发表于 : 2016-04-17 11:00
okudayukiko0
vickycq 写了:检查服务器 sshd_config 的 ClientAliveInterval, TCPKeepAlive 参数
检查客户端 ssh_config 的 ServerAliveInterval, TCPKeepAlive 参数
检查所用 shell 的自动登出设置,如 bash 的 TMOUT,csh 的 autologout

参考
http://serverfault.com/questions/278396 ... -on-ubuntu
https://docs.oseems.com/general/applica ... le-timeout
http://www.cyberciti.biz/faq/appleosx-b ... ash-shell/
Sshd_config加TCPKeepAlive yes,ClientAliveInterval 120,ClientAliveCountMax 5000也是一样,无操作过大约10分钟后自动断线。

Re: 怎样将SSH设置为一直连接(不断线)

发表于 : 2016-04-17 13:23
rosynirvana
有些参数是服务器上/etc/ssh/sshd_config中的
有些是客户端~/.ssh/config中的
不要搞混了