Solution: ssh_exchange_identification: Connection closed by remote host

Getting this error while accessing ssh configured on MAC OSX

“ssh_exchange_identification: Connection closed by remote host”

Solution:

Go to System preferencesSharing and enable remote login

Option is there to allow everybody to access through ssh else allow
specific users.

Turn OFF and turn it ON again and see if you are able to connect through
ssh

I could get exact error on system.log file

Open terminal #sudo tail -f /var/log/system.log

Feb 19 14:38:48 devsrv.local WindowServer[200]:
CGXRegisterWindowWithSystemStatusBar: window 17 already registered
Feb 19 14:39:18 devsrv.local sshd[1086]: fatal: /var/empty must be owned
by root and not group or world-writable.
Feb 19 14:39:27 devsrv.local sshd[1088]: fatal: /var/empty must be owned
by root and not group or world-writable.

It’s something permission related issue where /var/empty folder is not writable by root which was stopping to run ssh service

Open terminal #sudo chmod 755 /var/empty

You can do a reboot of the MAC OSX and you should be able to connect
through SSH without any error.

“ssh_exchange_identification: Connection closed by remote host”

One Comment

Add a Comment

Your email address will not be published. Required fields are marked *