bug: user accounts cannot use ping

Forum Forums Official Releases antiX-21/22 “Grup Yorum” bug: user accounts cannot use ping

Tagged: ,

  • This topic has 10 replies, 5 voices, and was last updated Jan 16-9:59 pm by caprea.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #97503
    Member
    techore

      On antiX, user accounts using ping recieve the error:

      ping: socket: Operation not permitted

      I looked at Debian 11 and found:

      sudo getcap /usr/bin/ping
      /usr/bin/ping cap_net_raw=ep

      On antiX, I executed the following:

      setcap cap_net_raw+ep /usr/bin/ping

      Results

      ping -c 3 127.0.0.1
      PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
      64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.031 ms
      64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.032 ms
      64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.031 ms
      
      --- 127.0.0.1 ping statistics ---
      3 packets transmitted, 3 received, 0% packet loss, time 2075ms
      rtt min/avg/max/mdev = 0.031/0.031/0.032/0.000 ms

      @anticapitalista, is this something that should be added to antiX?

      • This topic was modified 3 months, 3 weeks ago by techore.
      #97504
      Member
      PPC
        Helpful
        Up
        0
        ::

        Using my normal (non root) user on antiX 21 got me this:

        $ ping -c 3 127.0.0.1
        PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
        64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.101 ms
        64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.086 ms
        64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.081 ms
        
        --- 127.0.0.1 ping statistics ---
        3 packets transmitted, 3 received, 0% packet loss, time 2051ms
        rtt min/avg/max/mdev = 0.081/0.089/0.101/0.008 ms

        I did not get the “operation not permited” error…

        #97506
        Member
        techore
          Helpful
          Up
          0
          ::

          Unfortunately, it doesn’t work on antiX 22.

          Screen shot is from a fresh install of antiX 22 Base with updates on a virtual machine. Verified Core isn’t working, either.

          • This reply was modified 3 months, 3 weeks ago by techore.
          Attachments:
          #97509
          Forum Admin
          anticapitalista
            Helpful
            Up
            0
            ::

            Might it be because you are using a 4.9 kernel?

            I just tested live iso of antiX-22-full (64bit) booted in Virtualbox for both kernels and ping as user works out of the box.
            However, you are correct about antiX-22-base (64bit)

            Philosophers have interpreted the world in many ways; the point is to change it.

            antiX with runit - leaner and meaner.

            #97511
            Moderator
            caprea
              Helpful
              Up
              0
              ::

              On antiX21 everything is fine here

              On antiX22 as user
              Kernel: 5.10.142-antix.2-amd64-smp

              $ cat /etc/antix-version
              antiX-22-runit_x64-full Grup Yorum 18 October 2022
              
              $ LANG=C ping -c 3 127.0.0.1
              ping: socket: Operation not permitted
              
              
              $ getcap /usr/bin/ping
              helga@antix1:~
              
              
              $ sudo setcap cap_net_raw+ep /usr/bin/ping
              helga@antix1:~
              $ ping -c 3 127.0.0.1
              PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
              64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.016 ms
              64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.028 ms
              64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.029 ms
              
              --- 127.0.0.1 ping statistics ---
              3 packets transmitted, 3 received, 0% packet loss, time 2086ms
              rtt min/avg/max/mdev = 0.016/0.024/0.029/0.005 ms
              
              
              #97512
              Member
              techore
                Helpful
                Up
                0
                ::

                Okay, so I went ahead and downloaded each iso for antiX 22 x64 using sysv and runit and ‘getcap /usr/bin/ping’ for each one.

                Findings:

                  22 full x64: cap_net_raw+ep /usr/bin/ping is set
                  22 runit full x64: not set
                  22 base x64: not set
                  22 runit base x64: not set
                  22 core x64: cap_net_raw+ep /usr/bin/ping is set
                  22 runit core x64: not set.

                @anticapitalista, I did not test against different installed kernels. Is there a relationship between kernel and setcap? I can check if you want. Let me know.

                Hopefully, this helps.

                • This reply was modified 3 months, 3 weeks ago by techore.
                #97518
                Forum Admin
                anticapitalista
                  Helpful
                  Up
                  0
                  ::

                  I think I know what the issue is.
                  On systems that fail with user ping, install inetutils-ping (it will remove iputils-ping if installed).
                  This allowed me to ping on antiX-22-base as user

                  Philosophers have interpreted the world in many ways; the point is to change it.

                  antiX with runit - leaner and meaner.

                  #97519
                  Member
                  techore
                    Helpful
                    Up
                    0
                    ::

                    I think I know what the issue is.
                    On systems that fail with user ping, install inetutils-ping (it will remove iputils-ping if installed).
                    This allowed me to ping on antiX-22-base as user

                    Never occurred to me that ping would be installed by different packages. Something for me to remember and to do a ‘dpkg-query -S’.

                    Thank you, anticapitalista.

                    #97520
                    Forum Admin
                    anticapitalista
                      Helpful
                      Up
                      0
                      ::

                      Seems it is not as simple as I thought.
                      antiX-22-full has iputils-ping and ping as user works
                      antiX-22-base has iputils-ping and ping as user does not work
                      antiX-22-base installing inetutils-ping (which removes iputils-ping) and ping as user works.

                      Philosophers have interpreted the world in many ways; the point is to change it.

                      antiX with runit - leaner and meaner.

                      #97523
                      Member
                      Robin
                        Helpful
                        Up
                        0
                        ::

                        On antiX22 as user
                        Kernel: 5.10.142-antix.2-amd64-smp

                        $ cat /etc/antix-version
                        antiX-22-runit_x64-full Grup Yorum 18 October 2022
                        $ LANG=C ping -c 3 127.0.0.1
                        ping: socket: Operation not permitted

                        It seems to be even more difficult:
                        Also on antiX 22 full as user, (not fresh installed from 22 ISO but updated completely from antiX 21 using apt-upgrade and purging elogind/systemd)
                        Also Kernel 5.10.142-antix.2-amd64-smp

                        $ cat /etc/antix-version
                        antiX-21_x64-full Grup Yorum 31 October 2021

                        (it says still antiX-21, but acutally is 22 since completely upgraded to antix22 by apt-upgrade and purged elongind/systemd)

                        $ ping heise.de
                        PING heise.de (193.99.144.80) 56(84) bytes of data.
                        64 bytes from redirector.heise.de (193.99.144.80): icmp_seq=1 ttl=247 time=24.5 ms
                        64 bytes from redirector.heise.de (193.99.144.80): icmp_seq=2 ttl=247 time=23.3 ms
                        64 bytes from redirector.heise.de (193.99.144.80): icmp_seq=3 ttl=247 time=23.8 ms
                        ^C
                        --- heise.de ping statistics ---
                        3 packets transmitted, 3 received, 0% packet loss, time 2002ms
                        rtt min/avg/max/mdev = 23.303/23.868/24.548/0.514 ms
                        $ which ping
                        /usr/bin/ping
                        $ dpkg-query -S '/usr/bin/ping'
                        dpkg-query: Kein Pfad gefunden, der auf Muster /usr/bin/ping passt

                        (dpkg-query: no path found which matches /usr/bin/ping)

                        but:

                        $ dpkg-query -S /bin/ping
                        iputils-ping: /bin/ping

                        So there are two positions where ping binary is stored. While /bin/ping is controlled by and known to dpkg, actually used instead is /usr/bin/ping. Both binaries are byte-identical.

                        Windows is like a submarine. Open a window and serious problems will start.

                        #97524
                        Moderator
                        caprea
                          Helpful
                          Up
                          0
                          ::

                          antiX-22-full has iputils-ping and ping as user works

                          It does not work here as user on antiX22 runit full, like I already mentioned above.

                          Installed is iputils-ping

                        Viewing 11 posts - 1 through 11 (of 11 total)
                        • You must be logged in to reply to this topic.