Icmp Open socket: Operation not permitted when ping

hello,
I was sent from this topic PocketBeagle - Linux on ARM - eewiki. Basically I followed the instructions to boot up an iMX based evaluation board. I use
https://rcn-ee.com/rootfs/eewiki/minfs/ubuntu-16.04.3-minimal-armhf-2017-12-09.tar.xz for rootfs. The board booted up fine and I logged in ok (ubuntu/tempwd, logged in from the serial port), failed to ping 8.8.8.8.

I can ping the board from other computer in the network but the board itself cannot ping because of permission issue. I know I am root, as I can do dd command, etc… I can call “ping --help” but cannot do “ping 8.8.8.8”.

I followed someone note “setcap cap_net_raw+p /bin/ping” but met with message “unable to set CAP_SETFCAP effective capability: Operation not permitted”.

I cannot find any other hints to solve this problem. Can you please help ?

By the way, when I do “sudo ping 8.8.8.8”, I was met with message “sudo /usr/bin/sudo must be owned by uid 0 and have the setuid bit set”

@eelinux

Did you connect to the network?

sudo ifconfig -a
sudo dhclient eth0

That specific ubuntu image didn’t have connman installed by default to auto connect to the network.

I’ve got a newer version ubuntu that i’m slowly rolling out, just in the process of valding/updating all pages…

You can grab it here:
https://www.digikey.com/eewiki/display/linuxonarm/A10-OLinuXino-LIME#A10-OLinuXino-LIME-Ubuntu18.04LTS

Regards,

@RobertCNelson

Yes, my board connected to the network and was assigned IP address. I can ping the board but the board cannot ping the world. There are 2 issues, first sudo command does work ( met with udo /usr/bin/sudo must be owned by uid 0 and have the setuid bit set). Second, there seems to be network permission issue, when ping 8.8.8.8 (met with icmp open socket: Operation not permitted)

Can you please share with me how you may resolve this issue by with your building rootfs ?

@eelinux

Just installed the old ubuntu 16.04.3-minimal-armhf-2017-12-09 on a DE0 Altera board.

Ubuntu 16.04.3 LTS arm ttyS0

default username:password is [ubuntu:temppwd]

arm login: ubuntu
Password: 
Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.9.78-ltsi-socfpga-r4 armv7l)

ping just works…

ubuntu@arm:~$ ifconfig -a
eth0      Link encap:Ethernet  HWaddr e2:e7:c4:00:49:6b  
          inet addr:192.168.0.117  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::e0e7:c4ff:fe00:496b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST DYNAMIC  MTU:1500  Metric:1
          RX packets:86 errors:0 dropped:0 overruns:0 frame:0
          TX packets:61 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:13566 (13.5 KB)  TX bytes:7953 (7.9 KB)
          Interrupt:27 Base address:0x2000 

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:164 errors:0 dropped:0 overruns:0 frame:0
          TX packets:164 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:12200 (12.2 KB)  TX bytes:12200 (12.2 KB)

ubuntu@arm:~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=114 time=89.7 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=114 time=79.0 ms
^C
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 79.040/84.394/89.749/5.362 ms

I’d say, double check your rootfs install, the chown/chmod is critical to correct the base rootfs permissions:

sudo tar xfvp ./*-*-*-armhf-*/armhf-rootfs-*.tar -C /media/rootfs/
sync
sudo chown root:root /media/rootfs/
sudo chmod 755 /media/rootfs/

Regards,

@RobertCNelson

Thank you for your help! I have followed your instruction again and this time the rootfs worked, both sudo and ping. It was indeed permission issue. What I did wrong was using “sudo nautilus” to open file manager and did tar extract, copy & paste rootfs to SD card everything manually by drag and drop. Apparently, this came from a windows user background :slight_smile: