We recently had to rebuild one of our cloud servers (we use Rackspace). All servers are almost identical, and a snapshot of another server was used. Once live again, I allowed a cron job to run which syncs a couple of files outside source control from the original server to the newly rebuilt server, using Unison. Essentially this SSH's and compares files between the two then copies across/deletes/whatever files between the two machines.
However, since the rebuild, I'm getting emails from Cron Daemon giving me the following error:
ssh_exchange_identification: read: Connection reset by peer Fatal error: Lost connection with the server
The weird thing here is that if I login as the same user that the cron job runs under and SSH to the same server (using the same keys for auth) I don't see any errors. Also, if I run Unison manually from the command line, I see no errors. What's more, if I turn off Unison's silent mode then the output from a successful Unison batch job is shown in the console, and this same output is shown in an email, but I still get several others with the errors as above whenever the cron job runs.
I have checked permissions and content of the id_rsa/id_rsa.pub keys, authorized_keys, etc, and they seem fine.
Can anyone suggest why this might have suddenly started happening? It appears the sync is working but I'm getting several emails each time it runs with that error.