Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    pfSsh playback can't run as non-root after 24.11 update

    Scheduled Pinned Locked Moved General pfSense Questions
    7 Posts 3 Posters 730 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      Troutpocket
      last edited by

      I check status of the firewall services using some admittedly old nagios scripts which worked up until the 24.11 update. The script in question runs the command

      /usr/local/sbin/pfSsh.php playback svc status unbound
      

      which works great as root. However, I run it a regular user that has the "Shell Account Access" permissions so it can issue the command via SSH from our monitoring system. Output as root:

      Service unbound is running.
      

      Output as non-root:

      pkill: signalling pid 80772: Operation not permitted
      pkill: signalling pid 70664: Operation not permitted
      pkill: signalling pid 1978: Operation not permitted
      pkill: signalling pid 16781: Operation not permitted
      pkill: signalling pid 26111: Operation not permitted
      pkill: signalling pid 88576: Operation not permitted
      pkill: signalling pid 1378: Operation not permitted
      pkill: signalling pid 32947: Operation not permitted
      pkill: signalling pid 14192: Operation not permitted
      pkill: signalling pid 80772: Operation not permitted
      
      Service unbound is stopped.
      

      Whatever changed with 24.11 was probably for the best, but I'd like to fix the script so I can continue monitoring services. Any suggestions?

      link to nagios script from 7 years ago

      GertjanG 1 Reply Last reply Reply Quote 0
      • GertjanG
        Gertjan @Troutpocket
        last edited by Gertjan

        @Troutpocket said in pfSsh playback can't run as non-root after 24.11 update:

        Any suggestions?

        "Talking" to unbound directly is probably a thing of the past.
        Every self respecting process has now a "control(ler)" part these days. Use that to talk to unbound.
        Example :

        [24.11-RELEASE][root@pfSense.bhf.tld]/root: unbound-control -c /var/unbound/unbound.conf status
        version: 1.22.0
        verbosity: 1
        threads: 2
        modules: 3 [ python validator iterator ]
        uptime: 94422 seconds
        options: control(ssl)
        unbound (pid 67273) is running...
        

        About 'root' : unbound runs with root privileges, so mister nobody wouldn't be able to look into 'DNS stuff of everybody'.
        Also, pfSense isn't a multi user system anyway ... there is just 'one admin', like a car has only 'one driver'.

        edit
        dpinger is a home (Netgate) build 'simple' process, and hasn't any fancy support, not even an /usr/local/etc/rc.d file.

        You can still check if it's running : look :

        ps aux | grep 'dpinger'
        

        Dono what "apinger" is ...

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        1 Reply Last reply Reply Quote 0
        • stephenw10S
          stephenw10 Netgate Administrator
          last edited by

          The service status php script should still work though. Most likely it requires root and should not have run before. Some bug was fixed and now it correctly fails.

          Can your user run other php shell playback sessions?

          You might need to use the sudo package to allow it.

          Steve

          T 1 Reply Last reply Reply Quote 0
          • T
            Troutpocket @stephenw10
            last edited by

            @stephenw10 Thanks for the suggestion. Any particular playback scripts you recommend I should use to test?

            1 Reply Last reply Reply Quote 0
            • stephenw10S
              stephenw10 Netgate Administrator
              last edited by

              Try: pfSsh.php playback gatewaystatus

              That works here as a user with only the shell access privilege. But svc status fails.... which is interesting.

              T 1 Reply Last reply Reply Quote 0
              • T
                Troutpocket @stephenw10
                last edited by

                @stephenw10 Ya, that works. Nonetheless, I put a bandaid on it by adding a line to sudoers:

                nagios ALL=(ALL) NOPASSWD:/usr/local/sbin/pfSsh.php
                

                and adding a 'sudo' prefix to the command script. I'd rather not do that if the case is that the command should work without sudo, though.

                1 Reply Last reply Reply Quote 1
                • stephenw10S
                  stephenw10 Netgate Administrator
                  last edited by

                  Mmm, that is probably the way to go. Those scripts are expected to be run as root. Curious that it changed in 24.11 though.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.