大网数据广告活动
服务器运维问答

SSH issues: Read from socket failed: Connection reset by peer

· 52CE 我爱测

I compiled OpenSSH_6.6p1 on one of our server. I am able login via SSH to the upgraded server. But I am not able to connect to other servers running OpenSSH_6.6p1 or OpenSSH_5.8 from this. While connecting I am getting an error a…

问题原文

原帖链接 · nitin · CC BY-SA 4.0

I compiled OpenSSH_6.6p1 on one of our server. I am able login via SSH to the upgraded server. But I am not able to connect to other servers running OpenSSH_6.6p1 or OpenSSH_5.8 from this. While connecting I am getting an error as below.

Read from socket failed: Connection reset by peer

On the destination server in the logs, I am seeing it as below.

sshd: fatal: Read from socket failed: Connection reset by peer [preauth]

I tried specifying the cipher_spec [ ssh -c aes128-ctr destination-server ] as mentioned in ssh 'connection reset by peer' problem since 5.8p1 (archived version) and was able to connect. How can configure ssh to use the cipher by default? Why is the cipher required here?

社区高分解答

原帖链接 · Jānis Konošonoks · CC BY-SA 3.0

My way to fix it, hope it helps someone :

# Recreate host keys
sudo rm /etc/ssh/ssh_host_*
sudo ssh-keygen -A

# Re-install SSh
sudo apt-get --reinstall install openssh-server openssh-client

Edit sshd_config by adding a value

add :  MaxAuthTries 3

Edit ssh_config by uncommenting a value

Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2014-03-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0 / CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。