Ubuntu BBB ssh hanging and fickle ethernet

I got the Ubuntu img onto the BBB and can ssh in through the web arm interface at https://192.168.7.2:4200/, then u:ubuntu p:temppwd

However, I can’t ssh in via terminal. ssh ubuntu@192.168.7.2 -p 4200' just hangs. I can ping 192.168.7.2’ from my mac and it returns packets.

I also have ethernet attached to the BBB. If I boot up from the SD card image (the mounted disk is /BOOT), then I can get ethernet to work. However, if I boot up without the card (the mounted disk is /boot), then ethernet doesn’t work. The resulting ifconfig is below. I also tried ssh’ing through 192.168.2.2 to no success.

I can’t tell why this is. Is there some possibility that the image didn’t take correctly? I haven’t seen where I would use Robert’s linked .sh file that he graciously pointed me to in this thread because the bone booted up into Ubuntu without the card shortly after I used the card to boot it up via the USER BOOT button. It went through the process, had the four lights ON at once, and then I removed the 5V and powered it back on as expected from the imaging process.

Anyone seen this before? I didn’t see anything on the mailing list related to hanging SSH.


ubuntu@arm:~$ ifconfig                                                                                                             
eth0      Link encap:Ethernet  HWaddr c8:a0:30:b4:5c:78                                                                            
          inet addr:192.168.2.2  Bcast:192.168.2.255  Mask:255.255.255.0                                                           
          inet6 addr: fe80::caa0:30ff:feb4:5c78/64 Scope:Link                                                                      
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1                                                                       
          RX packets:328 errors:0 dropped:0 overruns:0 frame:0                                                                     
          TX packets:36 errors:0 dropped:0 overruns:0 carrier:0                                                                    
          collisions:0 txqueuelen:1000                                                                                             
          RX bytes:69511 (69.5 KB)  TX bytes:3552 (3.5 KB)                                                                         
          Interrupt:56                                                                                                             
                                                                                                                                   
lo        Link encap:Local Loopback                                                                                                
          inet addr:127.0.0.1  Mask:255.0.0.0                                                                                      
          inet6 addr: ::1/128 Scope:Host                                                                                           
          UP LOOPBACK RUNNING  MTU:65536  Metric:1                                                                                 
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0                                                                       
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0                                                                     
          collisions:0 txqueuelen:0                                                                                                
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)                                                                                   
                                                                                                                                   
usb0      Link encap:Ethernet  HWaddr 4a:19:5c:ad:6a:dc                                                                            
          inet addr:192.168.7.2  Bcast:192.168.7.3  Mask:255.255.255.252                                                           
          inet6 addr: fe80::4819:5cff:fead:6adc/64 Scope:Link                                                                      
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1                                                                       
          RX packets:707 errors:0 dropped:0 overruns:0 frame:0                                                                     
          TX packets:453 errors:0 dropped:0 overruns:0 carrier:0                                                                   
          collisions:0 txqueuelen:1000                                                                                             
          RX bytes:185852 (185.8 KB)  TX bytes:204451 (204.4 KB)   

Try just

ssh ubuntu@192.168.7.2

without the -p 4200.

regards,
Nuno

That yields

`ssh: connect to host 192.168.7.2 port 22: Connection refused’

The port seems relevant.

It is relevant, but the default port is 22. You can login and see which port the ssh daemon is listening:

Welcome to Ubuntu 13.04 (GNU/Linux 3.8.13-bone18 armv7l)

* Documentation: https://help.ubuntu.com/
Last login: Mon May 27 19:35:35 2013

ubuntu@arm:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 13.04
Release: 13.04
Codename: raring

ubuntu@arm:~$ dpkg --get-selections '*ssh*'
openssh-client install
openssh-server install
ssh-import-id install

ubuntu@arm:~$ sudo netstat -l -n -p |grep -i ssh
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 847/sshd
tcp6 0 0 :::22 :::* LISTEN 847/sshd

ubuntu@arm:~$ date
Tue Jun 4 03:28:49 UTC 2013

regards,
Nuno

Thanks for that. My system showed a bit differently with the netstat and the date. Namely, the date was wrong (May 29th) and the netstat had no ssh (result below). When i tried to /etc/init.d/ssh start', I was told to use service ssh start’, which then failed with the following error.

`start: Unable to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory’

ubuntu@arm:~$ sudo netstat -l -n -p |grep -i ssh


ubuntu@arm:~$ sudo netstat -l -n -p                                                                                                
Active Internet connections (only servers)                                                                                         
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name                                   
tcp        0      0 0.0.0.0:4200            0.0.0.0:*               LISTEN      747/shellinaboxd                                   
tcp6       0      0 :::80                   :::*                    LISTEN      786/apache2                                        
udp        0      0 0.0.0.0:67              0.0.0.0:*                           866/udhcpd                                         
udp        0      0 0.0.0.0:68              0.0.0.0:*                           900/dhclient                                       
udp        0      0 0.0.0.0:1283            0.0.0.0:*                           900/dhclient                                       
udp6       0      0 :::9609                 :::*                                900/dhclient                                       
Active UNIX domain sockets (only servers)                                                                                          
Proto RefCnt Flags       Type       State         I-Node   PID/Program name    Path                                                
unix  2      [ ACC ]     STREAM     LISTENING     4625     789/apache2         /var/run/apache2/cgisock.786                        
unix  2      [ ACC ]     STREAM     LISTENING     3253     1/init              @/com/ubuntu/upstart                                
unix  2      [ ACC ]     SEQPACKET  LISTENING     3485     315/udevd           /run/udev/control  

And if I try `sudo service ssh start’ , I get the following success msg, but no ssh process starts in netstat.

ssh start/running, process 1173

Forgot to mention, I run ubuntu from a SD card, still have Angstrom on
the eMMC and installed ubuntu 13.04 from:

http://elinux.org/BeagleBoardUbuntu#Raring_13.04_armhf

I didn't try the images you referred to, so I don't know how well they work,

cheers,
Nuno

I just tried booting from SD card and the same results exactly. Inserting the ethernet and pinging google doesn’t return anything but send out. I can ping 192.168.7.1 from my laptop and get a response though.


ubuntu@arm:~$ ping google.com                                                                                                      
PING google.com (74.125.226.225) 56(84) bytes of data. 
 

I just tried booting from SD card and the same results exactly. Inserting
the ethernet and pinging google doesn't return anything but send out. I can
ping 192.168.7.1 from my laptop and get a response though.

Well it should get 192.168.7.1 from the laptop, as that is the dhcp
address the bone will give you..

Port 4200 is just for the web service "shellinabox"

"ssh ubuntu@192.168.7.2" should work.. What's the exact response you get?

ubuntu@arm:~$ ping google.com
PING google.com (74.125.226.225) 56(84) bytes of data.

If that is over usb, did you create a bridge link? otherwise that is
not going to leave the bone by default.. (i'm working on something)

Regards,

“ssh ubu...@192.168.7.2” should work… What’s the exact response you get?

When I’m booting from SD or when I’m not, `ssh ubuntu@192.168.7.2’ yields:

ssh: connect to host 192.168.7.2 port 22: Connection refused

ubuntu@arm:~$ ping google.com
PING google.com (74.125.226.225) 56(84) bytes of data.

If that is over usb, did you create a bridge link? otherwise that is
not going to leave the bone by default… (i’m working on something)

I haven’t done anything extra to the connection.

(Thanks for taking a look at this guys.)

LOL! So just confirmed... I can't ssh over port 22 either.. That was
totally not planned... I'm guessing shellinabox reconfigured
/etc/ssh/ssh*....

PS: if while flashing you get the "two led" stuck on, use a 5volt
power supply, it ran out of juice with just the usb port..

Regards,

So with the debian 'flasher' some more details emerge:

debian@arm:~$ sudo /etc/init.d/ssh start
[....] Starting OpenBSD Secure Shell server: sshdPrivilege separation
user sshd does not exist
failed!

So i wonder if 'shellinabox' took something openssh was using?

Regards,

Robert, I am not sure how to diagnose this further. Can I provide you with any assistance, e.g. setup from my box?

Yeah for now i fixed it by dropping "shellinabox", as it worked
perfectly before adding that package..

https://github.com/RobertCNelson/omap-image-builder/commit/dff873e08ec0a25126480aa449f58e50dad9913a

So time to look at 'gate-one'.. but i will not be back home till saturday..

Regards,

Ok, I’ll re-eMMC it tonight with that change. Thanks.

Except I'm not home to regenerate the *.img and upload them... :wink:

I think if you do:

sudo apt-get remove shellinabox openssh-server --purge
sudo apt-get install openssh-server

It should work..

Regards,

Hmm, the bone stalled removing shellinabox. I also still don’t have ethernet, which I suspect is a different concern.

I’m thinking I’ll try a different img in the meanwhile. Does the Quantal one at elinux have the same problem?

Nah, it's going to have the same problem...

So here they are without shellinabox.. (120kb/s dl is about max.. :wink: )

http://rcn-ee.homeip.net:81/testing/pending/

ssh should work over port 22...

Regards,

Thanks so much for that Robert. The ssh works and that enables a lot for me.

However, the ethernet still won’t work. I’m pretty baffled by this because everything I’m seeing around suggests that it should ‘just work’ out of the box with ubuntu. I don’t have a firewall on my mac, I have port forwarding and internet sharing on, and everything looks fine to me. The bone’s ifconfig and resolv.conf are listed below. What would you do to debug this?

Thanks again.

ubuntu@arm:~$ cat /etc/resolv.conf

Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)

DO NOT EDIT THIS FILE BY HAND – YOUR CHANGES WILL BE OVERWRITTEN

nameserver 192.168.2.1
domain localdomain
search localdomain
nameserver 192.168.1.1

ubuntu@arm:~$ ifconfig -a

eth0 Link encap:Ethernet HWaddr c8:a0:30:b4:5c:78
inet addr:192.168.2.4 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::caa0:30ff:feb4:5c78/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:86 errors:0 dropped:0 overruns:0 frame:0
TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:19611 (19.6 KB) TX bytes:2206 (2.2 KB)
Interrupt:56

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

usb0 Link encap:Ethernet HWaddr 8e:ce:4c:9f:5b:a8
inet addr:192.168.7.2 Bcast:192.168.7.3 Mask:255.255.255.252
inet6 addr: fe80::8cce:4cff:fe9f:5ba8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:69 errors:0 dropped:0 overruns:0 frame:0
TX packets:46 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7169 (7.1 KB) TX bytes:8840 (8.8 KB)

So… after a couple of days of not being able to work with it, I powered it up today into my usb and inserted the ethernet, and boom it just worked. I just did a sudo apt-get and it was all good.

This is great and all, but I’m confused as to why. I didn’t do anything between last post and this one.