Backup to SSH server fails with kex_exchange_identification: read:

SYSTEM INFORMATION
OS type and version AlmaLinux 9.9
Webmin version 2.680
Virtualmin version 8.3.0 GPL
Webserver version Apache 2.4.62
Related packages SUGGESTED

I backup a Virtualmin system to a Synology NAS (DSM 7.1.1-42962 Update 10) using SSH for the backup file upload.

Until Saturday 29 Nov 2026 it worked very well (except removing old backups which broke a few versions of SSH ago).

Now it fails on the file upload with error

“Uploading archive to SSH server webbackup.xxxxx.net ..
.. upload failed : kex_exchange_identification: read: Connection reset by peer Connection reset by xxx:xxx:xxx:xxxx:xxxx:xxxx:xxxx:xxxx port 22 lost connection”

However, the initial test appears to succeed with message

“Testing backup destination web3/incremental/261129Sun2340 on SSH server webbackup.xxxxx.net ..
.. done”

I read that Webmin 2.680 introduced “Add TLS to fast RPC calls and file transfers on SSL servers, requiring remote peers to be upgraded first and rejecting unsupported peers or HTTPS-to-HTTP proxies without falling back to regular RPC”

Is this why it no longer works?

I had a self signed certificate on the Synology NAS, so I updated that to a LetsEncrypt certificate with the same hostname as is used by backup, thinking this may be required for TLS. But no improvement.

If I remember well, Virtualmin had an option to add command line options to the SSH command, but I no longer see that and I’m unsure what option to choose because I don’t really understand why it now fails.

I have tried enabling all SSH algorithms (setting Security level to low) on the Synology, but that seems unlikely since Virtualmin is more likely to remove algorithms due to insecurity than allow more. Anyway it did not resolve the error.

If I enter “ssh webbackup.xxx.net -p22” in a terminal window on the VM server I get a similar error “kex_exchange_identification: read: Connection reset by peer”

If I use Putty from a Windows 11 PC I can connect to the Synology with SSH on port 22.

The Synology firewall is unchanged, allowing only connections from the Virtualmin server and local network.

The version of sshd on the Synology is “OpenSSH_8.2pl, OpenSSL 1.1.1t 7 Feb 2023”

Any advice would be much appreciated, thanks.

No. SSH has no relation to TLS. Nothing to do with Webmin or Virtualmin at all.

And, this proves that, since Webmin isn’t involved at all when you call ssh directly:

This is a problem with either the ssh server or the ssh client. Probably the former. The connection is being reset by the server.

I’d enable verbose logging in the client (ssh -vvv) to see what it thinks is happening, but you probably need to check the server sshd log for the actual answer.

You don’t need Webmin to be involved in this troubleshooting, since you can reproduce the error by directly trying to login in with ssh, so you don’t need to make Webmin/Virtualmin use extra options to ssh, and nothing you change in Virtualmin can make it work as long as the server is resetting the connection during key exchange.

Many thanks Joe for your reply and your patience. The SSH client in this case is directed by Virtualmin and my limited expertise means I only have the backup log as diagnostic material.

However, I did have both IPv4 and IPv6 entries for the target server (i.e. the Synology). I removed the IPv6 entry and after the DNS TTL (5 mins), the backup is now working correctly.

I can’t explain it, but I felt maybe the backup was making several DNS queries at different stages of the backup and perhaps getting different answers (e.g. sometimes IPv4, sometimes IPv6).

Anyway, I’ll monitor for a while.

You said this:

So, you also have the ability to run the ssh client with verbose errors enabled. This isn’t a Virtualmin problem, you don’t need Virtualmin to troubleshoot it.

But, if disabling IPv6 solved it, you know where the problem is (misconfigured IPv6 on one side or the other). But, if you don’t need IPv6 for this connection, then just leaving it disabled also seems like a reasonable solution.

Thank you! Yes, it’s so obvious I didn’t see it. I was so focussed on trying to see the log of the ssh command executed by Virtualmin I didn’t notice my own contradiction. Mea culpa.