ssh server: reasons for sudden "Connection closed by remote host"

Now that you once again have access, check the log to determine what, if any, clues there are as to why you were blocked.

tail -n300 /var/log/auth.log | grep ssh 1

The other thing to remember is that, if it happens again, you can run ssh in verbose mode with the -vvv option, which will return more detailed diagnostic information. From man ssh:

-v    Verbose mode. Causes ssh to print debugging messages about its progress. This is helpful in debugging connection, authentication, and configuration problems. Multiple -v options increase the verbosity. The maximum is 3.



[1] You may need to increase/decrease the amount you tail by (-n) to identify the relevant entries.


Are you using some sort of automatic blocking? I have denyhosts isntalled, which will block the IP address after several failed login attempts, and I have locked myself out like this a few times.


Unlikely is a failed automatic package update.

Likely is a hardware failure, software failure (kernel resources leak), temporary routing failure, or hacking attempt gone awry.

I'm assuming a local managed user database for EC2.

Tags:

Openssh