in reply to OpenSSH and multiple users

su (on linux) creates a new shell.

In order to capture the output of that shell, you need to redirect the STDOUT of that shell to a file, then cat that in the original shell.

You appear to be connecting to a network device.
Try to chain the commands into an "sudo" type command, that retains the original shell control.

        "I can cast out either one of your demons, but not both of them." -- the XORcist

Replies are listed 'Best First'.
Re^2: OpenSSH and multiple users
by judgemstr (Novice) on Jan 04, 2016 at 21:51 UTC
    The FreeBSD servers are limited on what packages they contain to further lock down the security of them. I do not have sudo capabilities to use. The only way in remotely is ssh using the root key and passphrase and then use the su command into the admin userland to launch remaining commands.
      If you need to run a single command (as in your post), you can remove the separate "su" line, and try:
      $ssh->system("su -c 'show status' admin");
      Of course, you will need to remove the corresponding "exit", because this will run the command, and exit automatically.

              "I can cast out either one of your demons, but not both of them." -- the XORcist

        That got me a little bit closer but now I get this error.
        [172.16.100.27] su -c 'show status' admin Jan 4 14:16:30 <auth.err> 42 su: login_getclass: unknown class 'show +status' Remote Console Remote Console Press return for console: