首页 > 开发 > linux > 正文

通过ssh连入服务器然后vim代码, 经常会断掉连接, 显示 `Broken pipe`, 怎么改善?

2017-09-11 20:23:49  来源: 网友分享

用的aliyun服务器, 配置如下:

ubuntu 14.04CPU: 4核内存: 8GB带宽: 6Mbps

本地的环境:

archlinuxxfce4-terminal

在本地ping服务器:

from : icmp_seq=1 ttl=49 time=5.82 ms64 bytes from x.x.x.x: icmp_seq=2 ttl=49 time=11.1 ms64 bytes from x.x.x.x: icmp_seq=3 ttl=49 time=8.18 ms64 bytes from x.x.x.x: icmp_seq=4 ttl=49 time=7.46 ms64 bytes from x.x.x.x: icmp_seq=5 ttl=49 time=7.79 ms--- x.x.x.x ping statistics ---5 packets transmitted, 5 received, 0% packet loss, time 4006ms

ssh 设置参考 这篇wiki中的 Speeding up SSH, Keep alive 等章节.

通过ssh连入服务器vim代码, 经常断掉连接, 显示Broken pipe, 痛不能举.

目前在用的折中方法是 sshfs.

请问, 是哪里的存在短板? 还有没有其他更好的方法?

解决方案

在服務端安裝tmux 或者screen, ssh進入服務端後, 打開tmux 或者screen 的sessions. 這樣就算broken pipe後, 也可以重新鏈接.