in reply to Re: OpenSSH and multiple users
in thread OpenSSH and multiple users

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.

Replies are listed 'Best First'.
Re^3: OpenSSH and multiple users
by NetWallah (Canon) on Jan 04, 2016 at 22:20 UTC
    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:
        Hmmm . FreeBSD "su" interprets the "-c" option as "class". , so it is useless for your purpose.

        I dont see any good options. It looks like you will have to install "sudo" if it is not already installed on the target system.

        For instructions on sudo install see What's the sudo equivalent for FreeBSD?.

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