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

    driving me mental, remote login to pfsense CLI to shutdown

    Scheduled Pinned Locked Moved General pfSense Questions
    43 Posts 5 Posters 2.0k 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.
    • johnpozJ
      johnpoz LAYER 8 Global Moderator
      last edited by

      What are the permissions on the file? Why are you trying to use a different user and then another user to auth with?

      An intelligent man is sometimes forced to be drunk to spend time with his fools
      If you get confused: Listen to the Music Play
      Please don't Chat/PM me for help, unless mod related
      SG-4860 24.11 | Lab VMs 2.8, 24.11

      A 1 Reply Last reply Reply Quote 0
      • A
        automate @johnpoz
        last edited by

        @johnpoz

        The linux server has software on it called openhab. That software executes its scripts, or rules, using the openhab user. This is a home automation package.

        So, the openhab user executes the command but logs in with 'nsautomate'

        nsautomate@ihp:~$ sudo ls -la /var/lib/openhab2/.ssh/id_ed25519
        -rw------- 1 root root 411 Aug  5 10:39 /var/lib/openhab2/.ssh/id_ed25519
        nsautomate@ihp:~$
        
        
        1 Reply Last reply Reply Quote 0
        • johnpozJ
          johnpoz LAYER 8 Global Moderator
          last edited by

          that seems pointless.. if the user account openhab is going to run the command, just create that user on pfsense and use it to auth with and run the halt cmd.

          Only root can access that file, per the permissions on it.

          An intelligent man is sometimes forced to be drunk to spend time with his fools
          If you get confused: Listen to the Music Play
          Please don't Chat/PM me for help, unless mod related
          SG-4860 24.11 | Lab VMs 2.8, 24.11

          1 Reply Last reply Reply Quote 1
          • A
            automate
            last edited by automate

            Cool, that appears to have worked. However, its shut down pfsense but not powered off the unit, like it does if you select 'halt' from the GUI. I can still ping it but not SSH to it and its still forwarding packets despite a CLI message saying its being shut down??

            Is there an alternate command that shuts the whole system down gracefully?

            1 Reply Last reply Reply Quote 0
            • DerelictD
              Derelict LAYER 8 Netgate
              last edited by

              What kind of hardware?

              You probably want shutdown -p now

              https://www.freebsd.org/cgi/man.cgi?query=shutdown&manpath=FreeBSD+11.2-RELEASE

              Chattanooga, Tennessee, USA
              A comprehensive network diagram is worth 10,000 words and 15 conference calls.
              DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
              Do Not Chat For Help! NO_WAN_EGRESS(TM)

              A 1 Reply Last reply Reply Quote 1
              • johnpozJ
                johnpoz LAYER 8 Global Moderator
                last edited by

                He has something running on linux that he wants to ssh into pfsense using public key auth and run the rc.halt

                Which works just fine I have tested your old thread, on a VM running 2.4.4p3 - takes all of 30 seconds to setup.

                He is having a problem using public key auth in general.

                An intelligent man is sometimes forced to be drunk to spend time with his fools
                If you get confused: Listen to the Music Play
                Please don't Chat/PM me for help, unless mod related
                SG-4860 24.11 | Lab VMs 2.8, 24.11

                1 Reply Last reply Reply Quote 1
                • DerelictD
                  Derelict LAYER 8 Netgate
                  last edited by

                  Sounds like he got it working but didn't get a power off. /etc/rc.halt is probably a better option.

                  Chattanooga, Tennessee, USA
                  A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                  DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                  Do Not Chat For Help! NO_WAN_EGRESS(TM)

                  1 Reply Last reply Reply Quote 1
                  • A
                    automate @Derelict
                    last edited by

                    @Derelict it's intel i5 hardware. I'll try that option

                    1 Reply Last reply Reply Quote 0
                    • A
                      automate
                      last edited by

                      Thanks, etc/rc.halt does the trick

                      1 Reply Last reply Reply Quote 0
                      • A
                        automate
                        last edited by automate

                        @johnpoz said in driving me mental, remote login to pfsense CLI to shutdown:

                        ssh-keygen -o -t ed25519

                        Thanks John & Derelict! all working now :)

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