原创Couldn't read packet: Connection reset by peer 错误排查思路(推荐)
作为一个运维 不是你懂多少知识才是你的价值 你有幸能遇到多少错误才是你的最大的价值
知识 你有我有大家有 错误我有你没有 这便是我的价值
我遇到一个错误 蛮难遇到的一个错误 所以想分享给大家
下面我在模拟机演示给大家 用 root权限 避免你们说是因为权限的错误
2017年9月5日 我在切换sftp时候遇到一个错误(端口号是22 说写端口号的闭嘴)

[root@backup ssh]# sftp -oPort=22 root@10.0.0.31
Connecting to 10.0.0.31...
The authenticity of host '10.0.0.31 (10.0.0.31)' can't be established.
RSA key fingerprint is 25:4d:a6:65:1b:77:85:41:f0:18:07:c8:e0:12:c9:9b.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.0.0.31' (RSA) to the list of known hosts.
root@10.0.0.31's password:
subsystem request failed on channel 0
Couldn't read packet: Connection reset by peer
我们来看看这个错误
Couldn't read packet: Connection reset by peer
无法读取数据包:通过对等项重置连接
这是一个很难遇到的错误
排查之路:
tail -f /var/log/messages
Sep 5 12:31:53 backup sshd[3131]: subsystem request for sftp failed, subsyst found
Sep 5 12:37:15 backup sshd[3136]: Accepted password for root from 10.0.0.31 9088 ssh2
Sep 5 12:37:15 backup sshd[3136]: subsystem request for sftp
Sep 5 12:37:15 backup sshd[3136]: subsystem request for sftp failed, subsyst found
[root@backup ssh]# rpm -ql openssh-clients
/etc/ssh/ssh_config
/usr/bin/.ssh.hmac
/usr/bin/scp
/usr/bin/sftp
/usr/bin/slogin
/usr/bin/ssh
/usr/bin/ssh-add
/usr/bin/ssh-agent
/usr/bin/ssh-copy-id
[root@backup ssh]# grep sftp /etc/ssh/sshd_config
Subsystem sftp /usr/libexec/openssh/sftp-server
[root@backup ssh]# ll /usr/libexec/openssh/sftp-server
-rwxr-xr-x. 1 root root 67640 Mar 22 16:33 /usr/libexec/openssh/sftp-server
查看文档
If so, it's the cause of this error message. That's especially true if your sftp user is logging into a chrooted environment, where "/usr/lib" probably does not exist. My own sftp server is configured this way.
However, SSHD has the sftp functionality built-in and does not need to execute an external "helper" program like that. So, if you have a line like the above, it can be fixed by changing it to:
如果是,这是错误消息的原因。尤其是,如果您的sftp用户登录到一个chrooted环境,其中“/ usr /lib”可能不存在。我自己的sftp服务器是这样配置的。
但是,sshd具有内置的sftp功能,不需要执行像这样的外部“助手”程序。因此,如果您有类似上述的行,可以通过将其更改为:
错误解决逻辑图

原创Couldn't read packet: Connection reset by peer 错误排查思路(推荐)的更多相关文章
- 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 文件包含 ...
- Connection Reset By Peer 解析
linux网络编程 Connection reset by peer错误服务器向客户端发送了数据,客户端没有接收就关闭了,服务器read就会发生Connection reset by peer错误.我 ...
- nginx php fastcgi Connection reset by peer的原因及解决办法
Connection reset by peer 这个错误是在nginx的错误日志中发现的,为了更全面的掌握nginx运行的异常,强烈建议在nginx的全局配置中增加 error_log logs ...
- nginx错误分析 `104: Connection reset by peer`
故障描述 应用从虚拟机环境迁移到kubernetes环境中,有些应用不定时出现请求失败的情况,且应用没有记录任何日志,而在NGINX中记录502错误.我们查看了之前虚拟机中的访问情况,没有发现该问题. ...
- 【原创】Apache ab测试时出现:apr_socket_recv "connection reset by peer" 104
今天在用Apache自带的ab工具做以下简单的压测,本来是随便填几个参数,发现ab在1000并发以上报错:apr_socket_recv "connection reset by peer& ...
- Connection reset by peer原理解析
“Connection reset by peer”代表什么?“Connection reset by peer”表示当前服务器接受到了通信对端发送的TCP RST信号,即通信对端已经关闭了连接,通过 ...
- ssh_exchange_identification: read: Connection reset by peer 解决思路
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/Jdk_yxs/article/deta ...
- ”Connection reset by peer“引发的思考
闲来无事,把之前写的一个游戏服务器框架(<一个java页游服务器框架>),部署到阿里云服务器上,测试运行了下,结果看到后台log中打印出了“Connection reset by peer ...
- Error -27780: [GENERAL_MSG_CAT_SSL_ERROR]connect to host "124.202.213.70" failed: [10054] Connection reset by peer [MsgId: MERR-27780]
解决方案一: 备注: 此方案如果请求响应时间太长,勾选"WinInet replay instead of Sockets(Windows only)"将会导致如下错误:
随机推荐
- Echarts饼状图
<head> <meta charset="utf-8"> <title>ECharts</title> <script sr ...
- CGAffineTransform属性
transform我们一般称为形变属性,其本质是通过矩阵变化改变控件的大小.位置.角度等,这里我们通过一个例子来看一下具体的操作,在下面的例子中我们也会看到UIImageView控件的常用操作. - ...
- Watir: 应用Watir,调用AutoIT清空IE浏览器的Cookies
require 'win32ole'ai = WIN32OLE.new("AutoItX3.Control")ai.RunWait("RunDll32.exe InetC ...
- http基础知识摘录
HTTP是一个基于请求/响应模式的,无状态的协议 (只有客户端发送请求服务器才会响应,否则服务器不会主动发送信息的,无状态指客户端发过来一个请求服务端给你发回一个响应,接着你再去发送一个请求,服务器根 ...
- 浅谈getAttribute兼容性
最近终于证实tag.setAttribute("style", "color:#000;");在IE7中不起作用.于是百度了一些解决办法. IE的setAttr ...
- Code:NLog
ylbtech-Code:NLog 1. NLog介绍使用返回顶部 1. NLog是什么 NLog是一个基于.NET平台编写的类库,我们可以使用NLog在应用程序中添加极为完善的跟踪调试代码.NLog ...
- 当你触摸并按住触摸目标时候,禁止系统默认菜单-webkit-touch-call
当你触摸并按住触摸目标时候,禁止或显示系统默认菜单. -webkit-touch-callout 是一个 不规范的属性(unsupported WebKit property),它没有出现在 CSS ...
- HDU-5538 House Building
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submissio ...
- [工具]kali-linux-2016.2 更新后
使用官方的,会自动选择最近的服务器/etc/apt/sources.list # 就这一句就好了,不用添加一堆 deb http://http.kali.org/kali kali-rolling m ...
- 微信公众号开发及时获取当前用户Openid及注意事项
目录 (一)微信公众号开发之VS远程调试 (二)微信公众号开发之基础梳理 (三)微信公众号开发之自动消息回复和自定义菜单 (四)微信公众号开发之网页授权获取用户基本信息 (五)微信公众号开发之网页中及 ...