1

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$ 
  • looks like your sshd crashed. check logs on the server. – Memming Jun 30 '13 at 21:02
1

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' >> /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/

  • I kept looking and on my mac the .ssh folder is empty. could it be related? Changing the hosts.allow/deny on the rpi is problematic since i have no ssh access – e-r-a-n Jun 30 '13 at 14:24
  • Missing .ssh folder in mac home dir could be problematic only if you had access to Pi via keys that are stored there. Otherwise it is created to store connection info at first connect. Do you have root account enabled for ssh login, so you could try to get in via that? – b4d Jun 30 '13 at 14:34
  • To check if it is a settings problem on your mac accout, set up a new local account and login on mac desktop. Then try to connect as you would ssh usernameOnPi@192.168.178.24 – b4d Jun 30 '13 at 14:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .