Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Below I sun "su" command on FreeBSD:

FreeBSD rand.vstyle.local 9.0-RELEASE FreeBSD 9.0-RELEASE #0 amd64

This is server RAND :)

[svn@rand ~]$ su logostudiotest1 /bin/ls
Password:
/bin/ls: /bin/ls: cannot execute binary file

Why "su" does not work?!

share|improve this question
    
Silly question, maybe, but can you run /bin/ls as any other user? –  Jeff Albert Feb 4 '13 at 18:14
2  
whathaveyoutried.com (did you read the man page?) –  Luke404 Feb 4 '13 at 22:38

2 Answers 2

According to the su manpage if you want to run a command as another user using su, you should use the -c switch.

For example: su logostudiotest1 -c /bin/ls

share|improve this answer
4  
Yeah, this. The command given in the question won't work on Linux either. –  mattdm Feb 4 '13 at 19:32
2  
ls makes a lousy shell. –  David Schwartz Feb 5 '13 at 1:04

I think you've confused su with sudo. This should work fine:

# sudo -u logostudiotest1 /bin/ls
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.