ssh 链接服务器出现 Write failed: Broken pipe

方法来源 Ssh “Write failed: Broken pipe” - NewInstance

I started to get this error “Write failed: Broken pipe” when I was leaving the terminal alone.
Since plumbers are still expensive, despite the crisis, I decided to fix the pipe by myself.
Very easy, just add the following line to /etc/ssh/sshd_config:

ClientAliveInterval 60

This will send a “keep-alive” packet from the server to the terminal client every 60 seconds so that the connection doesn’t get dropped.

If you can’t fix it on the server, for example if you don’t have administrative rights, you can fix your client to send the “keep-alive” packet to the server every 60 seconds, adding this line to ~/.ssh/config

ServerAliveInterval 60

It’s also possible to specify the ServerAliveInterval at the ssh command line:

$ ssh -o ServerAliveInterval=60 [email protected]

More info about ClientAliveInterval and ServerAliveInterval can be found typing at the command line:

$ man 5 sshd_config
$ man 5 ssh_config
$ man ssh

Another reference  here

Your pipes should be safe now, and the plumbers out of business.

时间: 2024-08-06 11:11:12

ssh 链接服务器出现 Write failed: Broken pipe的相关文章

SSH "Write failed:Broken pipe"超时相关问题修复

博主热衷各种互联网技术,常啰嗦,时常伴有强迫症,常更新,觉得文章对你有帮助的可以关注我. 转载请注明"深蓝的镰刀" 在使用ssh时经常因为一段时间没有操作ssh,便出现了"Write failed:Broken pipe"的错误提示,然后就要重新再登录ssh的情况. 原因就是超过了服务器需要客户端发出响应的时间,解决办法只要配置一下服务器上的SSH即可. 打开/etc/ssh/sshd_config vim /etc/ssh/sshd_config 配置以下两项 C

(转) 解决ssh的"Write failed: Broken pipe"问题

解决ssh的"Write failed: Broken pipe"问题 问题场景 服务器环境:阿里云 Linux CentOS 主机 客户端:Mac OSX Terminal 问题现象 用 ssh 命令连接服务器之后,如果一段时间不操作,再次进入 Terminal 时会有一段时间没有响应,然后就出现错误提示: Write failed: Broken pipe 只能重新用 ssh 命令进行连接. 解决方法 方法一:如果您有多台服务器,不想在每台服务器上设置,只需在客户端的 ~/.ssh

解决Linux下ssh登录后出现 报错 Write failed: Broken pipe 的方法

解决也很简单,在执行 ssh 命令的时候,多加一个参数即可,如下: ssh -p 2200 -o ServerAliveInterval=60 [email protected] #服务器 8.8.8.8 的远程端口号为2200,增加标红的参数 原文地址:https://www.cnblogs.com/x00479/p/11327195.html

解决ssh链接服务器超时自动断开的问题

为了安全性:ssh默认的连接超时时间很短:经常就是发个呆就断开了:事实上是可以修改超时时间的. 示例环境: 服务器:centos6.5 1:[[email protected] /]cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak              //养成备份配置项的好习惯 2:[[email protected] /]vim /etc/ssh/sshd_config //删除110行ClientAliveInterval 0 前面的注释

linux下如何配置openvpn客户端,通过ssh链接服务器

openvpn安装 apt-get install openvpn openvpn配置 将ovpn配置文件拷贝到/etc/openvpn目录下 openvpn连接VPN服务器 openvpn --config /etc/openvpn/*.vnp mac下openvpn安装配置 http://www.lovessh.com/macosx-openvpn-client-tunnelblick-setup/ ubuntu下openvpn安装配置 http://www.myhack58.com/Art

git ssh 链接服务器报错

原文地址:http://blog.csdn.net/ausboyue/article/details/52775281 Linux SSH命令错误:ECDSA host key "ip地址" for  has changed and you have requested strict checking.记录下方便记忆. 解决方案:在终端上输入以下命令: ssh-keygen -R "你的远程服务器ip地址" 目的是清除你当前机器里关于你的远程服务器的缓存和公钥信息,

SSH 链接服务器超时自动断开问题解决办法

ssh -o ServerAliveInterval=60 [email protected]

PHP系列 | PDO::prepare(): send of 68 bytes failed with errno=32 Broken pipe

cli 模式报错 [2019-11-20T14:33:25+08:00][ error ] [8]PDO::prepare(): send of 68 bytes failed with errno=32 Broken pipe error 相关代码 class RedisSubscribe { public function subscribe() { $redis = BaseRedis::plocal(); $redis->setOption(\Redis::OPT_READ_TIMEOU

ssh远程链接服务器,避免因断网而中断训练方法

痛苦一觉醒来训练半小时 1.nohup 用途:不挂断地运行命令. 语法:nohup Command [ Arg … ] [ & ] 无论是否将 nohup 命令的输出重定向到终端,输出都将附加到当前目录的 nohup.out 文件中. 如果当前目录的 nohup.out 文件不可写,输出重定向到 $HOME/nohup.out 文件中. 如果没有文件能创建或打开以用于追加,那么 Command 参数指定的命令不可调用. 退出状态:该命令返回下列出口值:  126 可以查找但不能调用 Comman