Unable to run a command with arguments via SSH

  • Hi,

    I'm trying to execute a command with an argument via SSH, but the command is always executed without the arguments:

    $ ssh admin@ "uname"
    $ ssh admin@ "uname -a"

    While on a linux system this is working fine:

    $ ssh root@ "uname -a"
    Linux samplehost 3.10.0 ... x86_64 GNU/Linux

    Currently was unable to find the setting which might prevent this 😒

    Thanks a lot for your support in advance!

  • Hi,

    Well, another proof that "Linux" (a kernel) isn't FreeBSD (a kernel and the name of an OS) ? ;)
    pfSense, as a whole, can be considered an OS based on a 'mangled' up FreeBSD OS.

    When you ssh into pfSense, using ssh or Putty, you'll be seeing a ASCII menu, and your not dropped into some kind of online shell.
    Restart your command without 'uname' and you see what I mean.

    Btw : I saw in the doc / manual / forum that there are ways to drop in a shell right away.

  • Just found out that the menu which is started for the admin login is causing that the arguments for a SSH command execution are ditched. If you perform the same command with a different user it is working fine:

    $ ssh example@ uname -a
    FreeBSD examplehost 10.3-RELEASE-p22 FreeBSD 10.3-RELEASE-p22 ...  i386


  • Rebel Alliance Developer Netgate

    You can use root@ for that. Same password as admin, but without the menu lock-in.

  • root@ also drops me into the menu 🤔

    $ ssh root@
    pfSense - Netgate Device ID: xyz
    *** Welcome to pfSense 2.3.5-RELEASE (i386 full-install) on pfsense ***
     0) Logout (SSH only)                  9) pfTop
     1) Assign Interfaces                 10) Filter Logs
     2) Set interface(s) IP address       11) Restart webConfigurator
     3) Reset webConfigurator password    12) PHP shell + pfSense tools
     4) Reset to factory defaults         13) Update from console
     5) Reboot system                     14) Disable Secure Shell (sshd)
     6) Halt system                       15) Restore recent configuration
     7) Ping host                         16) Restart PHP-FPM
     8) Shell
    Enter an option:

    But interestingly the command arguments are working 😎

    $ ssh root@ uname -a
    FreeBSD ... root@ce23-i386-builder:/builder/pfsense-235/tmp/obj/builder/pfsense-235/tmp/FreeBSD-src/sys/pfSense  i386

  • Rebel Alliance Developer Netgate

    Yes, root takes you to the menu but doesn't lock you into the menu like admin.

  • Banned

    This post is deleted!

Log in to reply