Run shell command remotely



  • 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


  • Rebel Alliance Developer Netgate

    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
    


  • Great! Thanks  :D


Locked