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

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

Replies are listed 'Best First'.
Re^6: OpenSSH and multiple users
by afoken (Chancellor) on Jan 05, 2016 at 06:02 UTC
    FreeBSD "su" interprets the "-c" option as "class".

    Explicitly invoking sh should do the trick: su admin sh -c 'show status'

    Reading the fine manual suggests that the problem of "-c" could also be the order of arguments: su -c 'show status' admin has "-c" in front of the login parameter. Moving "-c" after the login parameter, as shown in the third example, should work: su admin -c 'show status'.

    Please note: everything posted here is untested, I currently have no FreeBSD machine to test.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
      Ok, so the su - admin -c 'show status'gives me the shell under admin which I need but doesnt run the show status command. Show status is a command that only exists in the userland which I think wont work here as the command it is passing thinks it on the root userland. I think our settings for these servers is too locked down to get in with what I am trying to do.