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

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". ;-)

Replies are listed 'Best First'.
Re^7: OpenSSH and multiple users
by judgemstr (Novice) on Jan 07, 2016 at 18:25 UTC
    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.