原创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)"将会导致如下错误:
随机推荐
- Opencv实现两幅图像融合
实现两幅图像线性(不同系数下)的融合涉及到Opencv中两个关键的方法,addWeighted()和createTrackbar() addWeighted方法: 函数原型: void addWeig ...
- [POI 2014] Little Bird
[题目链接] https://www.lydsy.com/JudgeOnline/problem.php?id=3831 [算法] 单调队列优化动态规划 时间复杂度 : O(N) [代码] #incl ...
- Watir: Win32ole对于excel某些指令无法操作的时候有如下解决方案
Similar Threads 1. WIN32OLE - failed to create WIN32OLE 2. WIN32OLE#[] and WIN32OLE#[]= method in Ru ...
- margin---bug
常见的浏览器下margin出现的bug IE6中双边距Bug:发生场合:当给父元素内第一个浮动元素设置margin-left(元素float:left)或margin-right(元素float:ri ...
- chromium浏览器开发系列第一篇:如何获取最新chromium源码
背景: 最近摊上一个事儿,领导非要让写一篇技术文章,思来想去,自己接触chrome浏览器时间也不短了,干脆就总结一下吧.于是乎,本文顺理成章.由于有些细节必需描述清楚,所以这次先讲如何拿到c ...
- HDU6038:Function(循环群/节+找公式)
传送门 题意 给出一个\(0\sim n-1\)的排列a,一个\(0\sim {m-1}\)的排列b,询问满足\[f(i)=b_{f(a_i)}~~(0\le i\le n-1)\]的函数的个数 分析 ...
- Codeforces Round #421 (Div. 2)D - Mister B and PR Shifts(模拟)
传送门 题意 给出n个数,计算在进行n-1次右移中\(min\sum_{i=1}^nabs(p_i-i)\) 分析 我们设置cnt[p[i]-i]为一个数p[i]与它标准位置(如1的标准位置为1)的左 ...
- PTA QQ Account Manageme【map的巧妙应有】
5-27 QQ Account Management (25分) You are supposed to implement the functions of account "Log in ...
- 【CodeForces - 546C】Soldier and Cards (vector或队列)
Soldier and Cards 老样子,直接上国语吧 Descriptions: 两个人打牌,从自己的手牌中抽出最上面的一张比较大小,大的一方可以拿对方的手牌以及自己打掉的手牌重新作为自己的牌, ...
- hdu2489 Minimal Ratio Tree dfs枚举组合情况+最小生成树
#include <stdio.h> #include <set> #include <string.h> #include <algorithm> u ...