OpenWrt 19: ssh_exchange_identification: Connection closed by remote host

After upgrading some devices to a build based on OpenWRT 19.07, revision r11325-616fff2a94, once the sysupgrade finishes, trying to connect via SSH from the management VPN to devices gives me this error:

ssh_exchange_identification: Connection closed by remote host

-v output:

OpenSSH_7.9p1 Debian-10+deb10u2, OpenSSL 1.1.1d  10 Sep 2019
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolve_canonicalize: hostname [ip] is address
debug2: ssh_connect_direct
debug1: Connecting to [ip] [[ip]] port 22.
debug1: Connection established.
debug1: identity file /root/.ssh/id_rsa type 0
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: identity file /root/.ssh/id_xmss type -1
debug1: identity file /root/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u2
ssh_exchange_identification: Connection closed by remote host

Connecting via LAN works.
After a while the problem goes away and I'm able to get in also via the management VPN, but may re-appear intermittently shortly afterwards.

If I reboot the device, I don't see the problem anymore.

I could ignore it but it's a bit worrying, I had not seen this behavior before on previous versions.
Is anybody else experiencing the same issue?

Based on my testing, I concluded that this is happening because I'm upgrading from a very old version of OpenWRT and no configuration is retained, not even the SSH host fingerprint, which causes issues when trying to reconnect via SSH initially.

The issue does not happen if I try to upgrade from a more recent version of OpenWRT using sysupgrade -c.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.