I have an RHEL 6.8 x86_64 server that has had a long running problem with the SSH server. It has openssh-5.3p1-118.1.el6_8.x86_64 installed. Every so many attempts to connect to SSH/SFTP, the server gives back the error:
ssh_exchange_identification: read: Connection reset by peer
It doesn't happen every time, so it is very hard to debug. When it does happen, even with more verbose logging, nothing shows up in the SSH logs about what happened. What I have noticed is that I have to restart sshd every few weeks or it quits working all together.
Can you offer any suggestions on how I could diagnose this issue and fix it?
Update (27-Aug-16): Here's the results of ssh -vvv
on a failed connection:
timothys-MacBook-Pro:~ tbutler$ ssh -vvv tbutler@myserver
OpenSSH_6.9p1, LibreSSL 2.1.8
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to myserver [xx.xx.xx.xx] port 22.
debug1: Connection established.
debug1: identity file /Users/tbutler/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/tbutler/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/tbutler/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/tbutler/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/tbutler/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/tbutler/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/tbutler/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/tbutler/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.9
ssh_exchange_identification: read: Connection reset by peer
I tried logging in again and received the same result. Finally on the third try, I was able to connect, which resulted in the debug information looking much the same, but then continuing with:
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH_5* compat 0x0c000000
0 Answers