作为一个运维 不是你懂多少知识才是你的价值 你有幸能遇到多少错误才是你的最大的价值

知识 你有我有大家有  错误我有你没有 这便是我的价值

我遇到一个错误 蛮难遇到的一个错误 所以想分享给大家

下面我在模拟机演示给大家 用 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 错误排查思路(推荐)的更多相关文章

  1. 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 文件包含 ...

  2. Connection Reset By Peer 解析

    linux网络编程 Connection reset by peer错误服务器向客户端发送了数据,客户端没有接收就关闭了,服务器read就会发生Connection reset by peer错误.我 ...

  3. nginx php fastcgi Connection reset by peer的原因及解决办法

    Connection reset by peer 这个错误是在nginx的错误日志中发现的,为了更全面的掌握nginx运行的异常,强烈建议在nginx的全局配置中增加 error_log   logs ...

  4. nginx错误分析 `104: Connection reset by peer`

    故障描述 应用从虚拟机环境迁移到kubernetes环境中,有些应用不定时出现请求失败的情况,且应用没有记录任何日志,而在NGINX中记录502错误.我们查看了之前虚拟机中的访问情况,没有发现该问题. ...

  5. 【原创】Apache ab测试时出现:apr_socket_recv "connection reset by peer" 104

    今天在用Apache自带的ab工具做以下简单的压测,本来是随便填几个参数,发现ab在1000并发以上报错:apr_socket_recv "connection reset by peer& ...

  6. Connection reset by peer原理解析

    “Connection reset by peer”代表什么?“Connection reset by peer”表示当前服务器接受到了通信对端发送的TCP RST信号,即通信对端已经关闭了连接,通过 ...

  7. ssh_exchange_identification: read: Connection reset by peer 解决思路

    版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/Jdk_yxs/article/deta ...

  8. ”Connection reset by peer“引发的思考

    闲来无事,把之前写的一个游戏服务器框架(<一个java页游服务器框架>),部署到阿里云服务器上,测试运行了下,结果看到后台log中打印出了“Connection reset by peer ...

  9. 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)"将会导致如下错误:

随机推荐

  1. Code:log4

    ylbtech-Code:log4 1.返回顶部   2.返回顶部   3.返回顶部   4.返回顶部   5.返回顶部 0. http://logging.apache.org/log4net/ 0 ...

  2. nable to load bean: type:com.opensymphony.xwork2.util.ValueStackFactory

    严重: Exception starting filter struts2 Unable to load bean: type:com.opensymphony.xwork2.util.ValueSt ...

  3. Python学习之旅—生成器对象的send方法详解

    前言 在上一篇博客中,笔者带大家一起探讨了生成器与迭代器的本质原理和使用,本次博客将重点聚焦于生成器对象的send方法. 一.send方法详解  我们知道生成器对象本质上是一个迭代器.但是它比迭代器对 ...

  4. ASP.NET Core MVC 2.x 全面教程_ASP.NET Core MVC 20. Model Binding

    模型绑定 这是个最简单的绑定 先从表单找.再从路由的值上找,最后去QueryString上找 通过反射获取这个类型的属性进行填充.反射完有几个属性,就开始去找着几个属性并绑定值 复杂类型 最后又加了一 ...

  5. 任务48:Identity MVC:Model后端验证

    任务48:Identity MVC:Model后端验证 RegisterViewModel using System; using System.Collections.Generic; using ...

  6. bash 脚本编程七 将命令输出保存到变量中(转载)

    转自:http://blog.csdn.net/csfreebird/article/details/7978699 `符号包含的命令执行完后,可以讲其输出结果保存到变量中 #!/bin/bash v ...

  7. ecb-2.40与cedet-1.1的兼容(转载)

    转自:http://blog.csdn.net/cnsword/article/details/7474119 今天凑热闹把fedora升级到了17,emacs升级到了24,但是悲剧了,显示cedet ...

  8. OC静态代码检查实战

    此文已由作者杨晓授权网易云社区发布. 欢迎访问网易云社区,了解更多网易技术产品运营经验. 在Mac OS系统上,采用Xcodebuild Analyze命令和OClint工具,对iOS项目进行静态代码 ...

  9. 51nod 1095【映射】

    思路: 利用一个map记录初始的,利用一个map记录排序后的. #include <bits/stdc++.h> using namespace std; map<string,in ...

  10. redis启停

    1 查看服务器上启动的redis服务 开了两个redis单机服务,监听在两个端口. 开了一个集群,监听在6个端口. [root@localhost bin]# ps aux | grep redis ...