Why does ssh fail with the messages "Connection closed by xxx.xxx.xxx.xxx"?
Environment
- Red Hat Enterprise Linux 5
- Red Hat Enterprise Linux 6
Issue
- Why does ssh fail with the messages "Connection closed by xxx.xxx.xxx.xxx"?
Resolution
Check LoginGraceTime in /etc/ssh/sshd_config and whether ssh server is very slow. If ssh server has dns access problem, it may take dozens of seconds to wait until DNS PTR queries time out.
From the man SSHD_CONFIG(5):
LoginGraceTime
The server disconnects after this time if the user has not successfully logged in.
If the value is 0, there is no time limit. The default is 120 seconds.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments