V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
1dian01
V2EX  ›  问与答

请教为啥 mac 下我用终端 ssh 上我的 vps 后过一会儿就没反应了(是自动断开?)

  •  
  •   1dian01 · 2014 年 8 月 10 日 · 5066 次点击
    这是一个创建于 4190 天前的主题,其中的信息可能已经有所发展或是发生改变。
    第 1 条附言  ·  2014 年 8 月 11 日
    在mac系统中打开 /etc/ssh_config 文件,加入 ServerAliveInterval 15 ,问题解决
    10 条回复    2014-08-10 23:27:16 +08:00
    hjc4869
        1
    hjc4869  
       2014 年 8 月 10 日
    这个问题我也经常遇到,不管是国内还是国外的VPS都是这样。
    yescola
        2
    yescola  
       2014 年 8 月 10 日
    你们看着 等会儿就有高手来回答了!楼下出来吧!
    tomheng
        3
    tomheng  
       2014 年 8 月 10 日
    设置下ServerAliveInterval 这个就行了。
    oldcai
        4
    oldcai  
    PRO
       2014 年 8 月 10 日
    /etc/ssh_config

    里面加入两行:
    ServerAliveInterval 60
    ServerAliveCountMax 0
    应该就好了
    yescola
        5
    yescola  
       2014 年 8 月 10 日
    @oldcai 你们都还没说完整,还要重启SSH服务才能生效!

    验证SSH服务状态,命令为:/etc/init.d/sshd status


    重新启动SSH服务,命令为:/etc/init.d/sshd restart
    sandtears
        6
    sandtears  
       2014 年 8 月 10 日
    @yescola 别闹,你修改客户端设定,重启 sshd 服务干嘛
    yescola
        7
    yescola  
       2014 年 8 月 10 日
    @sandtears 。。我是说的修改服务端。。。
    sandtears
        8
    sandtears  
       2014 年 8 月 10 日
    @yescola /etc/sshd_config 才是服务端的配置文件。
    yescola
        9
    yescola  
       2014 年 8 月 10 日
    @sandtears 赞一个。。!!!!!
    yescola
        10
    yescola  
       2014 年 8 月 10 日
    @sandtears 如果是使用 iTerm 的话,修改 /etc/ssh_config 有作用吗?!
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   4873 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 03:08 · PVG 11:08 · LAX 19:08 · JFK 22:08
    ♥ Do have faith in what you're doing.