ssh connection hangs/closes at debug1: expecting SSH2_MSG_KEX_ECDH_REPLY

Solution Verified - Updated -

Environment

Red Hat Enterprise Linux(all versions)

Issue

We have a database cluster where the management server needs to access all database servers, however, the accesses can no longer be remote.

Resolution

  • Make sure source, Intermediary devices and destination have the same MTU

Diagnostic Steps

  • Use ip ad | grep mtu command to check the MTU
  • Below the snip from ssh verbose output
$ ssh -vvv username@hostname
..
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
Connection closed by xx.xx.xx.xx port 22
..
  • Tcpdump output as below -
$ tshark -r 20-file.pcap -Y "tcp.stream==0"
..
 15          0 xx.xx.xx.xx -> yy.yy.yy.yy SSHv2 1562 [TCP Retransmission] Client: Key Exchange Init
..

  • From both, ssh verbose output and from tcpdump we can see that ssh key is not excepted and is being retransmitted.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments