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

iTerm2 如何保持连接

  •  
  •   JoeyChan · 2014-12-22 16:41:28 +08:00 · 27440 次点击
    这是一个创建于 3413 天前的主题,其中的信息可能已经有所发展或是发生改变。
    刚接触iTerm2,用起来感觉还不错,就是不知道如何保持连接,让ssh不断线。
    11 条回复    2015-11-10 11:40:37 +08:00
    kikyous
        1
    kikyous  
       2014-12-22 16:50:17 +08:00 via Android
    这不是iterm的事
    EPr2hh6LADQWqRVH
        2
    EPr2hh6LADQWqRVH  
       2014-12-22 16:51:17 +08:00
    是ISP切断的,无解
    shibo501c
        3
    shibo501c  
       2014-12-22 16:53:34 +08:00
    断网了就不行了,如果是关闭tab的话,重新打开快速连接的话,可以设置ssh/config
    cat ~/.ssh/config
    Host *
    ControlMaster auto
    ControlPath ~/.ssh/%h-%p-%r
    ControlPersist yes
    pinepara
        4
    pinepara  
       2014-12-22 16:56:50 +08:00
    mosh
    JoeyChan
        5
    JoeyChan  
    OP
       2014-12-22 17:15:35 +08:00
    谢谢几位解答,我意思不是指isp切断的问题,是ssh空闲断开的问题,securecrt有个send protocol no-op的功能,我是想实现同样的功能,还有就是,如果真的断线让它自动重连。
    tftk
        6
    tftk  
       2014-12-22 17:17:39 +08:00
    tmux 用了不想停。
    ernest
        7
    ernest  
       2014-12-22 17:18:53 +08:00
    tmux 根本停不下来
    Csineneo
        8
    Csineneo  
       2014-12-22 17:25:49 +08:00   ❤️ 4
    profiles -> sessions -> When idel, send ASCII code
    JoeyChan
        9
    JoeyChan  
    OP
       2014-12-22 17:35:22 +08:00
    @Csineneo 非常感谢,就是这个。
    tonghuashuai
        10
    tonghuashuai  
       2014-12-22 17:47:42 +08:00
    tmux +1
    Weeek
        11
    Weeek  
       2015-11-10 11:40:37 +08:00
    在客户端的 ~/.ssh/ 文件夹中添加 config 文件,并添加配置: ServerAliveInterval 60

    http://www.cnblogs.com/dudu/archive/2013/02/07/ssh-write-failed-broken-pipe.html
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2937 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 14:15 · PVG 22:15 · LAX 07:15 · JFK 10:15
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.