SSH的 Write failed: Broken pipe 问题
问题现象:

表示连接管道已经断开
解决方法:
方法一:客户端配置
在客户端的 ~/.ssh/ config文件(如不存在请自行创建)中添加下面内容:
ServerAliveInterval 60
方法二:服务器端配置
在服务器的 /etc/ssh/sshd_config 中添加如下的配置:
ClientAliveInterval 60
方法三:临时SSH命令配置
如果只是临时性的连接(即只作用于当前SSH),可以直接使用 ssh 命令参数进行配置。
$ ssh -o ServerAliveInterval=60 user@sshserver
//ServerAliveInterval
Sets a timeout interval in seconds after which if no data has
been received from the server, ssh(1) will send a message through
the encrypted channel to request a response from the server. The
default is 0, indicating that these messages will not be sent to
the server. This option applies to protocol version 2 only.
//ClientAliveInterval
Sets a timeout interval in seconds after which if no data has
been received from the client, sshd(8) will send a message
through the encrypted channel to request a response from the
client. The default is 0, indicating that these messages will
not be sent to the client. This option applies to protocol
version 2 only.
这两个命令前者应用在客户机上,后者应用在服务器上,如果没有管理员权限,那么前者是很好的选择。
这两个的功能是相同的,都是开启一个发送keep-alive包的功能,这样会允许客户端/服务器在一定时间内发送一个特定的包给对方,一旦超时,则说明断线,就关闭链接。这样就避免了链接长时间挂着导致报错。而且,一旦再次报错,稍等片刻便可以再次登录。
SSH的 Write failed: Broken pipe 问题的更多相关文章
- (转) 解决ssh的"Write failed: Broken pipe"问题
解决ssh的"Write failed: Broken pipe"问题 问题场景 服务器环境:阿里云 Linux CentOS 主机 客户端:Mac OSX Terminal ...
- SSH登陆 Write failed: Broken pipe解决办法
新装的一台linux 6.4主机在所有参数调优以后,运行起来要跑的程序后.再通过su - www时,提示如下: su: cannot set user id: Resource temporarily ...
- 解决ssh出现"Write failed: Broken pipe"问题
用 ssh 命令连接服务器之后,如果一段时间不操作,再次进入 Terminal 时会有一段时间没有响应,然后就出现错误提示: Write failed: Broken pipe 只能重新用 ssh 命 ...
- iTem2 保持连接,解决ssh的"Write failed: Broken pipe"问题
方法一: profiles -> sessions -> When idel, send ASCII code 问题场景 服务器环境:阿里云 Linux CentOS 主机 客户端:Mac ...
- 关于解决ssh的"Write failed: Broken pipe"问题
操作环境: 服务器:微软云 Linux CentOS 虚拟机 客户端:MAC OSX terminal 问题描述: 登录虚拟机短时间内不操作就会断开连接并报该“Write failed: Broken ...
- ssh连接报错Write failed: Broken pipe Resource temporarily unavailable
问题描述 使用root连接服务器正常,切换普通用户连接报错 具体报错如下:Write failed: Broken pipe 或者:failed to execute /bin/bash: Resou ...
- Linux(CentOS)上配置 SFTP(附解决Write failed: Broken pipe Couldn't read packet: Connection reset by peer)
#创建sftp组: groupadd sftp #创建一个用户sftpuser: useradd -g sftp -s /bin/false sftpuser #提示: /etc/group 文件包含 ...
- ssh连接linux服务器不断开- "Write failed: Broken pipe"
我自己用阿里云的服务器的时候,发现ssh连上以后,一会不用就断掉了,非常不方便,服务端的系统是ubuntu. 查了些东西,原来可以去配置服务端的sshd,或者客户端的ssh,就行了. 1,配置服务器端 ...
- 解决Linux下ssh登录后出现 报错 Write failed: Broken pipe 的方法
解决也很简单,在执行 ssh 命令的时候,多加一个参数即可,如下: ssh -p 2200 -o ServerAliveInterval=60 root@8.8.8.8 #服务器 8.8.8.8 的远 ...
随机推荐
- SQL Server 2019 深度解读:微软数据平台的野望
本文为笔者在InfoQ首发的原创文章,主要利用周末时间陆续写成,也算近期用心之作.现转载回自己的公众号,请大家多多指教. 11 月 4 日,微软正式发布了其新一代数据库产品 SQL Server 20 ...
- Python学习笔记之二——Python的运行机制,一般人肯定不会
前言本文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理.作者:XX Python解释器简介 解释器是一种让其他程序运行起来的程 ...
- usb工业相机之硬件设计-双缓冲-双端口sdram-fpga
usb工业相机之硬件设计-双缓冲-双端口sdram-fpga 在前期的产品设计中,采用cb提供的结构,68013直接操作摄像头,iic配置摄像头寄存器,板载晶振提供时钟,摄像头的pclk直接接ifcl ...
- 如何在JS代码中消除for循环
参考博客:https://www.cnblogs.com/momo798/p/10077600.html
- linux 各目录 常用用处
/bin : 存储常 用用户指令 /boot : 存储 核心.模块 映像等启 动用文件/dev : 存储 设备文件/etc : 存储 系统. 服 务的配置目录 与 文件/home : 存放 个人主目录 ...
- 《Java基础知识》Java类的定义及其实例化
类必须先定义才能使用.类是创建对象的模板,创建对象也叫类的实例化. 下面通过一个简单的例子来理解Java中类的定义: public class Dog { String name; int age; ...
- 比较typeof与instanceof
相同点: JavaScript中typeof和instanceof常用来判断一个变量是否为空,或者是什么类型的. 不同点: typeof的定义和用法: 返回值是一个字符串,用来说明变量的数据类型. 细 ...
- 去掉 Idea 中注入 Mapper 警告的方法
使用 Idea 的时候,自动装配 Mybatis 的 mapper.会一直出现红色波浪线的警告.看着难受.下面提供几种方式 方式一 为 @Autowired 注解设置required = false ...
- JPA中实现双向一对一的关联关系
场景 JPA入门简介与搭建HelloWorld(附代码下载): https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/103473937 ...
- 12-Factor与云原生
12-Factor与云原生 云原生应用 今天先到这儿,希望对技术领导力, 企业管理,系统架构设计与评估,团队管理, 项目管理, 产品管理,团队建设 有参考作用 , 您可能感兴趣的文章: 精益IT组织与 ...