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
| [reply] [d/l] |
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:
| [reply] [d/l] |
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
| [reply] |