SSH Connection Closed By Remote Host
Our SFTP batch job fails with the error message ssh_exchange_identification: Connection closed by remote host when connecting the destination server for downstream interface.
The SSH connection error is intermittent and happens on and off making it difficult to troubleshoot.
You can do a manual connection from your Unix shell using the SSH command as below.
$ ssh remote_ip or remote_hostname ssh_exchange_identification: Connection closed by remote host $ ssh -v remote_ip or remote_hostname OpenSSH_3.6.1p2, SSH protocols 1.5/2.0, OpenSSL 0x0090702f debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug1: Connecting to <remote_ip> [<remote_ip>] port 22. debug1: Connection established. debug1: identity file /home/username/.ssh/identity type -1 debug1: identity file /home/username/.ssh/id_rsa type -1 debug1: identity file /home/username/.ssh/id_dsa type -1 ssh_exchange_identification: Connection closed by remote host debug1: Calling cleanup 0x80627f0(0x0)
At first we thought the problem was caused by either /etc/hosts.allow or /etc/hosts.deny but the entry inside the files looks good.
We suspect the destination server which was used by other system for interface as well could not cope the number of SSH connection.
The parameter MaxStartups in the files /etc/ssh/sshd_config determine the number of maximum connection allowed for SSH.
$ grep MaxStartups /etc/ssh/sshd_config MaxStartups 20
The existing parameter shows that maximum 20 connection and any more new connection beyond will be blocked.
We increase the maximum number connection to 40 and continue to monitor the downstream batch job.
The maximum number of connection might be different on your system requirement case. Contact the system administrator and get their advice before making any change on the sshd_config file.
Related Posts
- Warning: Remote Host Identification Has Changed
- Oracle 10g Active Connection SQL
- Oracle 9i SQL Active Connection
PreviousNext» ORA-01031 Insufficient Privileges
- Trackback: Retry SFTP Connection In Shell Script




