Unable to SSH to Beagle Bone Black

Hi,

I got two BBBs in the mail - I plugged one in and everything has been working fine. SSHed to it, moved my s/w to it, etc. I then powered it off and plugged the other one in and can’t SSH to it. I get a ssh_exchange_identification: Connection closed by remote host error. I get this error no matter what machine I am trying to connect from. Someone on IRC had this same problem and didn’t think much of it then, but this is a board that is right out of the box and exhibiting this issue. The LEDs appear that it has booted fine.

`

cmicali@imac ~> ssh -vvv root@beaglebone.local
OpenSSH_5.9p1, OpenSSL 0.9.8r 8 Feb 2011
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 *
debug2: ssh_connect: needpriv 0
debug1: Connecting to beaglebone.local [192.168.1.32] port 22.
debug1**: Connection established.**
debug3: Incorrect RSA1 identifier
debug3: Could not load “/Users/cmicali/.ssh/id_rsa” as a RSA1 public key
debug1: identity file /Users/cmicali/.ssh/id_rsa type 1
debug1: identity file /Users/cmicali/.ssh/id_rsa-cert type -1
debug1: identity file /Users/cmicali/.ssh/id_dsa type -1
debug1: identity file /Users/cmicali/.ssh/id_dsa-cert type -1
ssh_exchange_identification: Connection closed by remote host

`

Any ideas what could be going on?

-chris

Just to elaborate on what Jimmy said. In case your known_hosts file is hashed and you’re having a hard time finding the right entries, you can either delete the entire file (not recommend), or you can use the keygen tool:

`

ssh-keygen -R beaglebone.local
ssh-keygen -R 192.168.1.32
`

After not being able to run the BBB web page scripts in my firefox i am accessing it through chrome
now i see chris having this ssh issue from a mac and i am having the same error from my windows box using either
putty or the built in one on the BBB error is as follows

[Press Shift-F1 for help]
                                                                                                                                              Host/IP or SSH URL [localhost]:
Port [22]:
User: root
Connecting to ssh://root@localhost:22
                                                                                                                                              
[Press Enter to close this terminal]

[Press Shift-F1 for help]
                                                                                                                                              Host/IP or SSH URL [localhost]:
Port [22]:
User: root
Connecting to ssh://root@localhost:22
                                                                                                                                              
[Press Enter to close this terminal]
  
[Press Shift-F1 for help]

Host/IP or SSH URL [localhost]:
Port [22]:
User: root
Connecting to ssh://root@localhost:22

ssh_exchange_identification: Connection closed by remote host
[Press Enter to close this terminal]

now i ran the set date button before doing this
wondering whats going on here

Thanks guys - unfortunately I had tried that and it did not solve the problem…

cmicali@cmicali-imac ~ [255]> ssh-keygen -R beaglebone.local /Users/cmicali/.ssh/known_hosts updated. Original contents retained as /Users/cmicali/.ssh/known_hosts.old cmicali@cmicali-imac ~> ssh-keygen -R 192.168.1.32 /Users/cmicali/.ssh/known_hosts updated. Original contents retained as /Users/cmicali/.ssh/known_hosts.old cmicali@cmicali-imac ~> ssh -vvv root@192.168.1.32 OpenSSH_5.9p1, OpenSSL 0.9.8r 8 Feb 2011 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 * debug2: ssh_connect: needpriv 0 debug1: Connecting to 192.168.1.32 [192.168.1.32] port 22. debug1: Connection established. debug3: Incorrect RSA1 identifier debug3: Could not load "/Users/cmicali/.ssh/id_rsa" as a RSA1 public key debug1: identity file /Users/cmicali/.ssh/id_rsa type 1 debug1: identity file /Users/cmicali/.ssh/id_rsa-cert type -1 debug1: identity file /Users/cmicali/.ssh/id_dsa type -1 debug1: identity file /Users/cmicali/.ssh/id_dsa-cert type -1 ssh_exchange_identification: Connection closed by remote host cmicali@cmicali-imac ~ [255]>

I even tried starting fresh by moving .ssh to .ssh-old and connecting, same behavior.

I would try accessing the BB via the serial console and see if there’s any SSH logs.

Yeah, I ordered the FTDI cable yesterday, arriving tomorrow… I’ll respond with what I find.

Just to follow up - I did not have the patience to wait for the FTDI cable to arrive so I re-flashed the eMMC using the provided latest image and that solved the problem.

how did you go about doing that ?
were the instructions on the BBB webpage the ones you followed ?

http://circuitco.com/support/index.php?title=BeagleBoneBlack

http://circuitco.com/support/index.php?title=Updating_The_Software

Gerald

after a flash to the newest version ssh works fine

so it seems to be something in the stock image that causes some boards to fail SSH

yay!

Correct. So, we will be moving to this as the production image (stock image) and as soon as Jason updates the webpage, everyone will have a place to find it.

Gerald

Did you rename the .ssh directory on your imac or on the Beaglebone?
The messages suggests that the files with RSA and DSA keys on your
workstation may be corrupted.

j.

Hi,

(Skip down to (5) to see the solution to ssh_exchange_identification: Connection closed by remote host.)

I updated to the 2013-05-02 image and I can’t log in via ssh anymore.

At first I got the error:

penSSH_5.9p1 Debian-5ubuntu1.1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to beaglebone [192.168.1.50] port 22.
debug1: Connection established.
debug1: identity file /home/user/.ssh/id_rsa type -1
debug1: identity file /home/user/.ssh/id_rsa-cert type -1
debug1: identity file /home/user/.ssh/id_dsa type -1
debug1: identity file /home/user/.ssh/id_dsa-cert type -1
debug1: identity file /home/user/.ssh/id_ecdsa type -1
debug1: identity file /home/user/.ssh/id_ecdsa-cert type -1
ssh_exchange_identification: Connection closed by remote host

I don’t have any identity files on the client.

  1. I tried ssh’ing into another machine and it works fine.

  2. I then updated ssh with ‘opkg update && opkg upgrade’ to a slightly newer version (I forget the detailed version number, the last digit was incremented…it reports Dropbear sshd v2012.55 on the command line).

  3. I tried moving away my .ssh/know_hosts file on the client but I got the same error.

  4. I noticed when I ‘/etc/init.d/dropbear restart’ that it seemed like it never started because it couldn’t be found when stopping.

5) From looking at the script above (/etc/init.d/dropbear) it seems like the identity file in /etc/dropbear/dropbear_rsa_host_key might be causing the problem and the script recreates them if they don’t exist. So I removed it and started dropbear (/etc/init.d/dropbear start) again and it generated new keys and then I could ssh in. It now works! (The side effect of doing this is you also have to remove a line in the client’s ~/.shh/know_hosts because the identity of the beaglebone has changed.)

Glen

Thanks! Was having the same problem, this script fixed it right up.

i just get “true” as response in console when starting and stopping that script in C9.

I guess I have to change the os to get access to the board. Node.js would have been nice to try but no can do…

You should uncheck the “run in debug mode” to simple run mode in C9. Then the script will work as expected.

+1 for +Martin Schweizer, great solution with the script.

Remember to uncheck the “run in debug mode” in C9 to run the script.

i too am unable to ssh to my beagle bone black i received tonight. i am using os x and am able to get to the bbb homepage. i tried Martin S.'s script (not in debug) and “it seems that you have another problem, sorry”. any more ideas i can try?

Thanks,
Brian

Can you post your console log when you use ssh -vvv?

Thanks , works ok
Henry