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

Unable to run a command with arguments via SSH

Scheduled Pinned Locked Moved Off-Topic & Non-Support Discussion
7 Posts 4 Posters 805 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.
  • M
    mattpoe
    last edited by May 3, 2019, 11:36 AM

    Hi,

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

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

    While on a linux system this is working fine:

    $ ssh root@192.168.1.2 "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!

    1 Reply Last reply Reply Quote 0
    • G
      Gertjan
      last edited by May 3, 2019, 12:01 PM

      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.

      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 1
      • M
        mattpoe
        last edited by May 3, 2019, 12:11 PM

        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@192.168.1.1 uname -a
        FreeBSD examplehost 10.3-RELEASE-p22 FreeBSD 10.3-RELEASE-p22 ...  i386
        

        Thanks!

        1 Reply Last reply Reply Quote 1
        • J
          jimp Rebel Alliance Developer Netgate
          last edited by May 3, 2019, 1:19 PM

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

          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 1
          • M
            mattpoe
            last edited by mattpoe May 6, 2019, 11:37 AM May 6, 2019, 11:35 AM

            root@ also drops me into the menu 🤔

            $ ssh root@192.168.1.1
            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@192.168.1.1 uname -a
            FreeBSD ... root@ce23-i386-builder:/builder/pfsense-235/tmp/obj/builder/pfsense-235/tmp/FreeBSD-src/sys/pfSense  i386
            
            1 Reply Last reply Reply Quote 0
            • J
              jimp Rebel Alliance Developer Netgate
              last edited by May 6, 2019, 12:23 PM

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

              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 1
              • W
                watsson Banned
                last edited by Jun 4, 2019, 10:01 AM

                This post is deleted!
                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                  [[user:consent.lead]]
                  [[user:consent.not_received]]