刚搞个阿里云的Centos6.5我自己用MACOS10.8.5使用ssh隧道时总是出现Write failed: Broken pipe这个问题,所以找了一下。在客户端的 ~/.ssh/ 文件夹中添加 config 文件,加上ServerAliveInterval 60在服务器的 /etc/ssh/sshd_config 中添加ClientAliveInterval 60也可以在使用命令行时用ssh -o ServerAliveInterval=60 user@sshserver这种形式