I also had a lot of trouble with this and I found Aaron Felts post down 
below very useful. I found that my BBB was at 100% disk usage and I 
couldn't SSH in.  I was able to use the Cloud9 IDE to get in at port 3000 
and use this javascript file to delete the log files and restart dropbear. 
 After that I was able to SSH in and I then changed the journaling settings 
to make sure this didn't happen again.

--Warning, this will delete your journal logs--


var exec = require('child_process').exec;
function puts(error, stdout, stderr) { console.log(error); 
console.log(stdout); console.log(stderr); }

// 1 - Clear journal space
exec("df -h; rm -rf /var/log/journal/; df -h", puts);

// 2 - Remove Dropbear file
exec("rm /etc/dropbear/dropbear_rsa_host_key", puts);

// 3 - Stop Dropbear
exec("/etc/init.d/dropbear stop", puts);

// 4 - Start Dropbear
exec("/etc/init.d/dropbear start", puts);


Then check out this post to set journaling settings to limit disk space 
usage:
https://groups.google.com/forum/#!searchin/beagleboard/journal%7Csort:date/beagleboard/1NguS-SK-G8/EdbLDWfl4IUJ

Hope that helps!

On Saturday, May 11, 2013 12:25:12 PM UTC-7, Martin Schweizer wrote:
>
> inspired by this post a have a simple solution for those who have the 
> problem and can't connect via serial console
>
> open the cloud9 and create a new file with the following script and start 
> it, or place the script in any textbox where you can interact with your 
> beaglebone and press run
>
> /* 
> https://groups.google.com/forum/?fromgroups=#!msg/beagleboard/Ya2qE4repSY/u4lvOjF66JEJ*/
>
> 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");
>   }
> });
>
>
>
> Am Samstag, 4. Mai 2013 05:27:26 UTC+2 schrieb Glen H:
>
> 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
>
> On Friday, May 3, 2013 7:55:16 PM UTC-4, Gerald wrote:
>
> 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
>
>
>
> On Fri, May 3, 2013 at 6:52 PM, evilwulfie <[email protected]> wrote:
>
>  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!
>
>
>
>
>
> On 5/3/2013 9:50 AM, Gerald Coley wrote:
>  
> http://circuitco.com/support/index.php?title=BeagleBoneBlack
>
>  http://circuitco.com/support/index.php?title=Updating_The_Software
>  
>  
>  Gerald
>  
>
> On Fri, May 3, 2013 at 11:36 AM, evilwulfie <[email protected]> wrote:
>
>  how did you go about doing that ?
> were the instructions on the BBB webpage the ones you followed ? 
>
>
>
> On 5/3/2013 8:01 AM, cmicali wrote:
>    
> 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.   
>
>  
> On Thursday, May 2, 2013 1:26:25 PM UTC-4, cmicali wrote: 
>
> Yeah, I ordered the FTDI cable yesterday, arriving tomorrow..  I'll 
> respond with what I find.
>
> On Thursday, May 2, 2013 12:26:39 PM UTC-4, Jason Stapels wrote: 
>
> I would try accessing the BB via the serial console and see if there's any 
> SSH logs. 
>
>  
> On Thursday, May 2, 2013 11:05:45 AM UTC-4, cmicali wrote: 
>
> 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 [email protected]
> 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.
>
>
> On Wednesday, May 1, 2013 8:13:08 PM UTC-4, Jason Stapels wrote: 
>
> 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: 
>
>   host> ssh-keygen -R beaglebone.local
> host> ssh-keygen -R 192.168.1.32
>  
>
> On Wednesday, May 1, 2013 6:07:47 PM UTC-4, [email protected] wrote: 
>
> I don't have a BBB yet, but I imagine that your ~/.ssh/known_hosts  file 
> has an entry in it for beaglebone.local. remove that line and then you 
> should be able to ssh to the second BBB. Now when you go back to the 
> original BBB it won't match the entry in .ssh/known_hosts (it now matches 
> the second board). Delete the line again for beaglebone.local and you can 
> ssh to the first one. 
>
> Jimmy
>
> On Wednesday, May 1, 2013 2:39:49 PM UTC-7, cmicali wrote: 
>
> 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 [email protected]
> 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/.<
>
> ...

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to