Go to Top

SSH over USB to BeagleBone Black

I picked up a BeagleBone Black, and immediately I’m impressed. This thing seems ‘polished’ in comparison to other DIY hardware packages. The default Angstrom distribution, not my favorite by a long shot might I add, is configured very well. Plugging in the USb cable from my Fedora/Macbook hybrid, the blue LED’s immediately come to life, and I am directed to head over to This address, of course being the IP of the BBB, has a webserver up and running, and it is directly speaking to the hardware on board. There is even a link to run a local script, which keeps all the LEDs light for a short period of time. Slick.

Immediately, I know I’m going to enjoy this embeded Linux machine. Of coure, the next thing I attempt is to SSH over USB to my new toy:

ssh -l root
ssh_exchange_identification: read: Connection reset by peer


The .ssh/known_hosts file isn’t happy, on the BBB. Luckily, we have a way of getting there and cleaning things up. This is provided through the (SUPER SLICK) on board Cloud9 IDE. Access it here: By running the following script in the browser, we can clean up the known_hosts file, and give ourselves SSH access to the hardware.

var fs = require('fs');
var destroyed_key_file = '/etc/dropbear/dropbear_rsa_host_key';
fs.readFile(destroyed_key_file, function (err, data) {
if (err) throw err;

if( data===null || data.length===0 )
console.log("we have a corrupted host key file... try do delete it");
fs.unlink(destroyed_key_file, function (err) {
if (err) throw err;
console.log('successfully deleted ' + destroyed_key_file);
console.log('you should now reboot your beaglebone.');
console.log('the /etc/init.d/dropbear script will create a new rsa host key file for you.');
console.log('after the reboot you should be able to login over ssh');
} else {
console.log("it seems that you have another problem, sorry");

This code snippet came from a mailing list post, which can be found here.
Reboot, and you should be good to go:

[jayt@localhost ~]$ ssh -l root
The authenticity of host ' (' can't be established.
RSA key fingerprint is bd:e7:0d:68:58:0e:4a:ab:08:9a:54:c5:39:d5:51:a0.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '' (RSA) to the list of known hosts.
root@'s password:

Comments (8)

  • Stephanie DiBianco February 23, 2014 - 9:03 pm Reply

    Nice work, very helpful.

  • Dimitri April 2, 2014 - 2:19 pm Reply

    It resolves my problem, thanks!

  • Soren April 17, 2014 - 4:46 pm Reply

    I am only getting “true” output in the console when I try to run the code.
    What am I doing wrong?

    • mmmoore13 January 7, 2015 - 8:48 pm Reply

      I am using chrome and only get “true” as well, tho I am getting no change from the ssh. What’s holding me back?

  • Soren April 17, 2014 - 4:47 pm Reply

    Op! Got it, I was using Safari, I switched to Chrome and it worked instantly. THANK YOU!

  • 101glover July 31, 2014 - 6:07 pm Reply

    This worked for me and I appreciate you posting it but what is the ” -l ” option? I don’t understand why it is included.

  • 101glover July 31, 2014 - 6:09 pm Reply

    to clarify ssh -l root worked for me and I am inquiring about the -l option in this command.

    • jay August 2, 2014 - 7:24 pm Reply

      The -l option lets you specify a user account in the destination host you want to login into. In this case, we wanted to login as the root account. Alternatively, you could have used: root@

Leave a Reply