Read from socket failed: Connection reset by peer 问题

简介:

http://blog.sina.com.cn/s/blog_893ee27f0100z5pt.html

通常,在linux中使用ssh的时候,如果出现这个错误,建议首先去查看log。

ubuntu的ssh的log记录在/var/log/auth.log

log错误会类似于如下:

  • Dec 22 09:43:35 x079-liongao sshd[14892]: error: This private key will be ignored.  
  • Dec 22 09:43:35 x079-liongao sshd[14892]: error: bad permissions: ignore key: /etc/ssh/ssh_host_dsa_key  
  • Dec 22 09:43:35 x079-liongao sshd[14892]: error: Could not load host key: /etc/ssh/ssh_host_dsa_key 
  • Dec 22 09:43:35 x079-liongao sshd[14892]: error: This private key will be ignored.  
  • Dec 22 09:43:35 x079-liongao sshd[14892]: error: bad permissions: ignore key: /etc/ssh/ssh_host_rsa_key  
  • Dec 22 09:43:35 x079-liongao sshd[14892]: error: Could not load host key: /etc/ssh/ssh_host_rsa_key 

找到问题所在,用如下命令

ssh-keygen -t dsa -P '' -f  /etc/ssh/ssh_host_dsa_key  

ssh-keygen -t rsa -P '' -f  /etc/ssh/ssh_host_rsa_key 

分别把这两个密钥生成就可以正常启动和使用 ssh了 。

到此问题就解决完了。

如果想深层次的了解这个的话可以去看看

/etc/ssh/ssh_config 和 /etc/ssh/sshd_config

据我所知 ssh  的配置文件就是这两个。


本文转自    拖鞋崽      51CTO博客,原文链接:http://blog.51cto.com/1992mrwang/1121740

相关文章
成功解决: Client network socket disconnected before secure TLS connection was established
这篇文章记录了在使用Avue时遇到的"Client network socket disconnected before secure TLS connection was established"错误的解决方法,即通过修改为国内镜像(如淘宝npm镜像)来解决安装问题,并提供了具体的命令示例以及安装成功后的截图。
成功解决: Client network socket disconnected before secure TLS connection was established
|
6月前
|
消息中间件 Kafka
org.apache.kafka.common.KafkaException: Socket server failed to bind to 114.115.20.100:9092: Cannot
org.apache.kafka.common.KafkaException: Socket server failed to bind to 114.115.20.100:9092: Cannot
75 0
|
Java 关系型数据库 MySQL
14. 成功解决:ERROR:ssl_client_socket_impl.cc(992) handshake failed; returned -1, SSL error code 1, net_error -103
今天使用 Python 的 selenium 时,一直在报如下错误:[30616:22540:0328/093748.004:ERROR:ssl_client_socket_impl.cc(992)] handshake failed; returned -1, SSL error code 1, net_error -100
4210 0
|
运维 网络协议 网络安全
Closed socket connection for client /39.103.162.230:56100 (no session established for client)
Closed socket connection for client /39.103.162.230:56100 (no session established for client)
507 0
Closed socket connection for client /39.103.162.230:56100 (no session established for client)
|
前端开发 Python
解决报错:Websocket connection to‘ws://127.0.0.1:5000/socket.io/?EIO=4&transport=websocket’failed:Error
报错全文为:Websocket connection to‘ws://127.0.0.1:5000/socket.io/?EIO=4&transport=websocket’failed:Error during Websocket handshake:Unexpected response code:400。如下图所示。
解决报错:Websocket connection to‘ws://127.0.0.1:5000/socket.io/?EIO=4&transport=websocket’failed:Error
|
Java 应用服务中间件 测试技术
Tomcat异常——ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
Tomcat异常——ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
956 0
Tomcat异常——ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
|
Java
IDEA 出现问题:JDWP Transport dt_socket failed to initialize, TRANSPORT_LOAD(509)解决方案(JAVA 小虚竹)
IDEA 出现问题:JDWP Transport dt_socket failed to initialize, TRANSPORT_LOAD(509)解决方案(JAVA 小虚竹)
785 0
IDEA 出现问题:JDWP Transport dt_socket failed to initialize, TRANSPORT_LOAD(509)解决方案(JAVA 小虚竹)
|
Apache 网络协议 应用服务中间件
下一篇
无影云桌面