V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
acess
V2EX  ›  问与答

为啥 ssh 掉线了, who 还能看到一堆会话残留在那里?

  •  
  •   acess · Oct 5, 2017 · 2176 views
    This topic created in 3130 days ago, the information mentioned may be changed or developed.
    ssh 连上服务器,然后拔掉网线,再结束进程就能复现。直接结束进程时好像会重置连接,就不会残留。
    是我的 sshd_config 搞错了什么吗?
    5 replies    2017-10-06 08:23:44 +08:00
    acess
        1
    acess  
    OP
       Oct 5, 2017
    TCPKeepAlive 已经是 yes,为啥没起效呢。
    要设置 ClientAliveInterval 么?这和 TCPKeepAlive 并不是一回事啊,而且开启后应该就不方便当隧道用了。
    trepwq
        2
    trepwq  
       Oct 5, 2017 via iPhone
    看一下路由器里转发 session 的生存时间,有些比较短,家用路由一般为 86400 秒
    ysc3839
        3
    ysc3839  
       Oct 6, 2017 via Android
    拔了网线的话服务器那边不知道你掉线了,要过了 timeout 才算掉线。
    acess
        4
    acess  
    OP
       Oct 6, 2017
    @ysc3839 看网上的资料,启用 TCPKeepAlive 应该就没这问题了啊。
    ysc3839
        5
    ysc3839  
       Oct 6, 2017 via Android
    @acess 我也不太懂这个,搜到了这个 http://www.firefoxbug.com/index.php/archives/2805/ 可能是要连续多次未响应才算掉线吧?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   846 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 19:43 · PVG 03:43 · LAX 12:43 · JFK 15:43
    ♥ Do have faith in what you're doing.