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

    Run shell command remotely

    Scheduled Pinned Locked Moved General pfSense Questions
    3 Posts 2 Posters 7.5k 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.
    • B
      bdaniel7
      last edited by

      Hi,

      I need to remotely and automatically run a shell command on the pfsense machine; is it possible?
      I was thinking to use plink but i can't pass by the menu that it appears at login via ssh.
      Also I considered using the "Command prompt" option but I can't automatise it.

      Thanks,
      Dan

      1 Reply Last reply Reply Quote 0
      • jimpJ
        jimp Rebel Alliance Developer Netgate
        last edited by

        When using ssh, login as "root" and not "admin" – you can then bypass the menu and run commands directly.

        ssh from a UNIX system will work, and on Windows plink works too, like so:

        C:\Program Files\PuTTY>plink -ssh -pw pfsense root@192.168.1.1 "cat /etc/version"
        1.2.3-RELEASE
        

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 0
        • B
          bdaniel7
          last edited by

          Great! Thanks  :D

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