Cant SSH from my mac computer: ssh_exchange_identification I try to ssh to my local raspberry pi and I get:

eran-mac:~ eran$ ssh 192.168.178.24
ssh_exchange_identification: Connection closed by remote host
eran-mac:~ eran$ 


I tried with -v and then:

eran-mac:~ eran$ ssh -v 192.168.178.24
OpenSSH_5.9p1, OpenSSL 0.9.8x 10 May 2012
debug1: Reading configuration data /Users/eran/.ssh/config
debug1: /Users/eran/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: /etc/ssh_config line 53: Applying options for *
debug1: Connecting to 192.168.178.24 [192.168.178.24] port 22.
debug1: Connection established.
debug1: identity file /Users/eran/.ssh/id_rsa type -1
debug1: identity file /Users/eran/.ssh/id_rsa-cert type -1
debug1: identity file /Users/eran/.ssh/id_dsa type -1
debug1: identity file /Users/eran/.ssh/id_dsa-cert type -1
ssh_exchange_identification: Connection closed by remote host
eran-mac:~ eran$
Most of the time it is a server side problem, so check your Raspberry Pi.

Majority of GNU/Linux distributions have /var/log/secure, you can find more data about why connection is closed.

Also check /etc/hosts.deny and /etc/hosts.allow if they are maybe blocking the access. Quick fix can be running this command in shell:

echo 'SSHD: ALL' &gt;&gt; /etc/hosts.allow


Some additional solutions that you can check can be found here http://www.linuxquestions.org/questions/linux-software-2/ssh_exchange_identification-connection-closed-by-remote-host-103423/