
On 29 June 2015 at 22:00, Russell Coker <russell@coker.com.au> wrote:
Error1: ssh_exchange_identification: Connection closed by remote host
Error2: ssh_exchange_identification: Connection closed by remote host rsync: connection unexpectedly closed (0 bytes received so far) [Receiver] rsync error: unexplained error (code 255) at io.c(605) [Receiver=3.0.9]
I normally see this error when there's some authentication problem. In the past, it has either been due to hosts.deny/hosts.allow rules, or if the server has no daemons available for authentication (the MaxStartups value in sshd_config). I also think I've seen it when the nofile ulimit has been reached for the user trying to authenticate.
I'm getting lots of errors like the above from cron jobs in situtions where running the same script from an interactive session works. The first error is from a cron job that rsync's files to a server and the second error is from rsyncing files from the server via ssh. On one of my systems I've seen a pair of cron jobs fail with that error every half hour for the past 4 hours but when I run both jobs from an interactive session they work every time.
What can be different about the operation of ssh in this regard? It's a passwordless login with RSA key so there's no reason for it to need user input and in any case the error message doesn't indicate that as being a problem.
I've compared the cron environment with the environment from the interactive session and apart from /bin/sh (DASH on Debian) vs /bin/bash I can't see anything of note.
Any ideas?
Instead of trying an rsync, can you get the cron script to run a command via ssh, with max verbosity? e.g. ssh -vvv user@server /usr/bin/id just to see where the ssh process is failing? Sean
-- My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/ _______________________________________________ luv-main mailing list luv-main@luv.asn.au http://lists.luv.asn.au/listinfo/luv-main