Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Praktische Anwendungen (Showcase)
    4. Radar2 läßt sich nicht mit root rechten ausführen

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Radar2 läßt sich nicht mit root rechten ausführen

    This topic has been deleted. Only users with topic management privileges can see it.
    • Thomas Braun
      Thomas Braun Most Active @necromonger last edited by

      @necromonger

      groups
      

      Und bitte die komplette Ein- und Ausgabe zeigen. Inkl. login prompt.
      Also so ungefähr:

      pi@raspberrypi:~ $ groups
      pi adm dialout cdrom sudo audio video plugdev games users input netdev gpio i2c spi iobroker
      
      1 Reply Last reply Reply Quote 0
      • N
        necromonger last edited by necromonger

        @Thomas-Braun said in Radar2 läßt sich nicht mit root rechten ausführen:

        groups

        codiergott@iobroker-vm:/$ sudo -u iobroker groups
        iobroker tty dialout audio video
        codiergott@iobroker-vm:/$ whoami
        codiergott
        codiergott@iobroker-vm:/$ sudo whoami
        root
        codiergott@iobroker-vm:/$ groups
        codiergott dialout cdrom floppy sudo audio dip video plugdev netdev iobroker
        codiergott@iobroker-vm:/$
        

        Hatte IOBroker schon einmal auf einen Pi zu laufen und dort lief es ohne Probleme. Dort ging auch das setzen der Capabitilities.

        Thomas Braun 2 Replies Last reply Reply Quote 0
        • Thomas Braun
          Thomas Braun Most Active @necromonger last edited by

          @necromonger
          Also bei meinem System funktioniert das:

          pi@raspberrypi:~ $ sudo setcap cap_net_admin,cap_net_raw,cap_net_bind_service=+eip $(eval readlink -f `which arp-scan`)
          pi@raspberrypi:~ $
          
          1 Reply Last reply Reply Quote 0
          • N
            necromonger last edited by necromonger

            Auf meinem Pi ging das auch. Nur auf einer frischen Debian 10 installation geht es irgendwie nicht. Hab Debian 10 neu aufgesetzt und dann probiert. Das gleiche.
            Mit getcap bekomme ich folgende Ausgabe:

            codiergott@iobroker-vm:/$ sudo which arp-scan
            /usr/sbin/arp-scan
            codiergott@iobroker-vm:/$ sudo getcap /usr/sbin/arp-scan
            /usr/sbin/arp-scan = cap_net_bind_service,cap_net_admin,cap_net_raw+eip
            

            Das sieht für mich korrekt aus!

            Thomas Braun 1 Reply Last reply Reply Quote 0
            • Thomas Braun
              Thomas Braun Most Active @necromonger last edited by

              @necromonger

              which arp-scan
              

              und dann ersetzt du das im setcap entsprechend:

              pi@raspberrypi:~ $ which arp-scan
              /usr/sbin/arp-scan
              pi@raspberrypi:~ $ sudo setcap cap_net_admin,cap_net_raw,cap_net_bind_service=+eip $(eval readlink -f /usr/sbin/arp-scan)
              
              S 1 Reply Last reply Reply Quote 0
              • Thomas Braun
                Thomas Braun Most Active @necromonger last edited by

                @necromonger
                Kann auch sein, dass die 'Netzwerkkarte' in der VM nicht mit arp-scan umgehen kann. Das ganze ist recht hardwarenah, wenn ich mich recht entsinne.

                1 Reply Last reply Reply Quote 0
                • N
                  necromonger last edited by

                  Das funktioniert reibungslos. Bei /etc/sudoers ist folgende Zeile als Kommentar markiert:

                  #includedir /etc/sudoers.d
                  

                  Die Zeile fügt doch alle Dateiinhalt aus /etc/sudoers.d der Datei hinzu. Also auch die Konfig von IOBroker.

                  Thomas Braun 1 Reply Last reply Reply Quote 0
                  • Thomas Braun
                    Thomas Braun Most Active @necromonger last edited by Thomas Braun

                    @necromonger Die Zeile tut gar nix, die ist auskommentiert. Und fummel da nix rum.

                    1 Reply Last reply Reply Quote 0
                    • N
                      necromonger last edited by

                      Das ist korrekt. Ich habe aber unter /etc/sudoers.d eine Datei zu liegen mit folgenden Name: iobroker

                      Diese hat folgenden Inhalt:

                      iobroker ALL=(ALL) ALL
                      iobroker ALL=(ALL) NOPASSWD: /usr/sbin/shutdown
                      iobroker ALL=(ALL) NOPASSWD: /usr/sbin/halt
                      iobroker ALL=(ALL) NOPASSWD: /usr/sbin/poweroff
                      iobroker ALL=(ALL) NOPASSWD: /usr/sbin/reboot
                      iobroker ALL=(ALL) NOPASSWD: /usr/bin/systemctl start
                      iobroker ALL=(ALL) NOPASSWD: /usr/bin/systemctl stop
                      iobroker ALL=(ALL) NOPASSWD: /usr/bin/mount
                      iobroker ALL=(ALL) NOPASSWD: /usr/bin/umount
                      iobroker ALL=(ALL) NOPASSWD: /usr/bin/systemd-run
                      iobroker ALL=(ALL) NOPASSWD: /usr/bin/apt-get
                      iobroker ALL=(ALL) NOPASSWD: /usr/bin/apt
                      iobroker ALL=(ALL) NOPASSWD: /usr/bin/dpkg
                      iobroker ALL=(ALL) NOPASSWD: /usr/bin/make
                      iobroker ALL=(ALL) NOPASSWD: /usr/bin/ping
                      iobroker ALL=(ALL) NOPASSWD: /usr/sbin/setcap
                      iobroker ALL=(ALL) NOPASSWD: /usr/bin/cat
                      iobroker ALL=(ALL) NOPASSWD: /usr/bin/df
                      iobroker ALL=(ALL) NOPASSWD: /usr/sbin/ldconfig
                      ALL ALL=NOPASSWD: /usr/bin/systemctl start iobroker
                      ALL ALL=NOPASSWD: /usr/bin/systemctl stop iobroker
                      ALL ALL=NOPASSWD: /usr/bin/systemctl restart iobroker
                      ALL ALL=(iobroker) NOPASSWD: /usr/bin/node /opt/iobroker/node_modules/iobroker.js-controller/iobroker.js *
                      

                      Dies wird dann nicht in die sudoers Datei eingefügt.

                      Thomas Braun 1 Reply Last reply Reply Quote 0
                      • Thomas Braun
                        Thomas Braun Most Active @necromonger last edited by Thomas Braun

                        @necromonger Doch, das ist richtig so wie es ist.

                        which setcap
                        

                        Kannst auch mal den

                        iobroker fix
                        

                        durchjagen.

                        1 Reply Last reply Reply Quote 0
                        • N
                          necromonger last edited by

                          which setcap

                          /usr/sbin/setcap
                          

                          iobroker fix durchgejagt und neugestartet. Gleicher Fehler!

                          1 Reply Last reply Reply Quote 0
                          • N
                            necromonger last edited by necromonger

                            @Thomas-Braun said in Radar2 läßt sich nicht mit root rechten ausführen:

                            sudo setcap cap_net_admin,cap_net_raw,cap_net_bind_service=+eip $(eval readlink -f which l2ping)

                            Fehler gefunden:

                            sudo setcap cap_net_admin,cap_net_raw,cap_net_bind_service=+eip $(eval readlink -f /usr/sbin/arp)
                            

                            Kommandozeile hat bei der Installation irgendwie nicht funktioniert!

                            Jetzt läuft alles!!

                            Danke dir für deine Hilfe!

                            Thomas Braun 1 Reply Last reply Reply Quote 0
                            • Thomas Braun
                              Thomas Braun Most Active @necromonger last edited by Thomas Braun

                              @necromonger sagte in Radar2 läßt sich nicht mit root rechten ausführen:

                              sudo setcap cap_net_admin,cap_net_raw,cap_net_bind_service=+eip $(eval readlink -f which l2ping)

                              Das ist ja auch falsch. Da fehlen die Hochkommata um which l2ping
                              Hatte ich aber auch so nicht geschrieben.

                              1 Reply Last reply Reply Quote 0
                              • S
                                steimi @Thomas Braun last edited by

                                @thomas-braun ich habe (vermutlich nach dem Update auf Debian 12) das selbe Problem.

                                bei dem Befehl "which arp-scan" und "arp" kommt unter dem User iobroker immer die Meldung

                                iobroker@iobroker:~$ arp-scan
                                -bash: arp-scan: Kommando nicht gefunden.
                                

                                somit laufen auch die beiden setcap-Befehle für arp & arp-scan auf Fehler.

                                
                                iobroker@iobroker:~$ sudo setcap cap_net_admin,cap_net_raw,cap_net_bind_service=+eip $(eval readlink -f `which arp-scan`)
                                readlink: fehlender Operand
                                „readlink --help“ liefert weitere Informationen.
                                usage: setcap [-h] [-q] [-v] [-n <rootid>] (-r|-|<caps>) <filename> [ ... (-r|-|<capsN>) <filenameN> ]
                                
                                 Note <filename> must be a regular (non-symlink) file.
                                 -r          remove capability from file
                                 -           read capability text from stdin
                                 <capsN>     cap_from_text(3) formatted file capability
                                 [ Note: capsh --suggest="something..." might help you pick. ]
                                 -h          this message and exit status 0
                                 -q          quietly
                                 -v          validate supplied capability matches file
                                 -n <rootid> write a user namespace (!= 0) limited capability
                                 --license   display the license info
                                iobroker@iobroker:~$
                                
                                

                                Im Log für Radar2 kommt dann

                                Adapter not running as root or iobroker has no sudo right, cannot use arp-scan!
                                

                                Gruppenzugehörigkeit ist folgende:

                                iobroker@iobroker:~$ sudo -u iobroker groups
                                iobroker tty dialout cdrom floppy sudo audio dip video plugdev netdev bluetooth
                                

                                was kann/muss ich tun?

                                System ist aktuell, js-controller 5.0.12/node 18.17.1

                                Thomas Braun 1 Reply Last reply Reply Quote 0
                                • Thomas Braun
                                  Thomas Braun Most Active @steimi last edited by

                                  @steimi sagte in Radar2 läßt sich nicht mit root rechten ausführen:

                                  was kann/muss ich tun?

                                  Schau mal ob das überhaupt installiert ist.

                                  sudo apt update
                                  apt policy arp-scan
                                  
                                  S 1 Reply Last reply Reply Quote 0
                                  • S
                                    steimi @Thomas Braun last edited by

                                    @thomas-braun

                                    iobroker@iobroker:~$ sudo apt update
                                    apt policy arp-scan
                                    OK:1 https://security.debian.org/debian-security bookworm-security InRelease
                                    OK:2 https://deb.debian.org/debian bookworm InRelease
                                    Holen:3 https://deb.debian.org/debian bookworm-updates InRelease [52,1 kB]
                                    OK:4 https://deb.debian.org/debian stable InRelease
                                    Holen:5 https://deb.nodesource.com/node_18.x bookworm InRelease [4.586 B]
                                    Es wurden 56,7 kB in 1 s geholt (80,5 kB/s).
                                    Paketlisten werden gelesen… Fertig
                                    Abhängigkeitsbaum wird aufgebaut… Fertig
                                    Statusinformationen werden eingelesen… Fertig
                                    Alle Pakete sind aktuell.
                                    arp-scan:
                                      Installiert:           1.10.0-2
                                      Installationskandidat: 1.10.0-2
                                      Versionstabelle:
                                     *** 1.10.0-2 500
                                            500 https://deb.debian.org/debian bookworm/main amd64 Packages
                                            500 https://deb.debian.org/debian stable/main amd64 Packages
                                            100 /var/lib/dpkg/status
                                    iobroker@iobroker:~$
                                    
                                    Thomas Braun 2 Replies Last reply Reply Quote 0
                                    • Thomas Braun
                                      Thomas Braun Most Active @steimi last edited by

                                      @steimi

                                      Keine Ahnung. Hier läuft es... 😉

                                      Kann aber vom Büro aus nicht tiefer buddeln, wo es da bei dir klemmen könnte.

                                      type -p arp-scan
                                      

                                      liefert?

                                      S 1 Reply Last reply Reply Quote 0
                                      • Thomas Braun
                                        Thomas Braun Most Active @steimi last edited by

                                        @steimi sagte in Radar2 läßt sich nicht mit root rechten ausführen:

                                         500 https://deb.debian.org/debian bookworm/main amd64 Packages                                                                    
                                        
                                            500 https://deb.debian.org/debian stable/main amd64 Packages
                                        

                                        Das ist übrigens eine Doublette. Solange bookworm=stable ist kein Problem. Könnte allerdings eins werden, wenn trixie=stable wird.

                                        S 1 Reply Last reply Reply Quote 0
                                        • S
                                          steimi @Thomas Braun last edited by

                                          @thomas-braun
                                          danke erstmal für die schnelle Hilfe. wenn du irgendwann Zeit hast reicht mir das.

                                          type -p arp-scan
                                          

                                          liefert gar kein Ergebnis?!

                                          1 Reply Last reply Reply Quote 0
                                          • S
                                            steimi @Thomas Braun last edited by steimi

                                            @thomas-braun danke für den Hinweis bzgl sources.list, habe es angepasst

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            929
                                            Online

                                            31.6k
                                            Users

                                            79.6k
                                            Topics

                                            1.3m
                                            Posts

                                            4
                                            31
                                            1489
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo