Yesterday,I used sudo to do some administrative task as root.However,if I issue command "sudo -u user command",the computer told me that permission denied.And it's strange that when I issue this command without specifying user(I log in as that user),the command will go fine. :scratch:

Now if you do "sudo -l" as user "swiftsmart" you'll see you can "sudo -u nobody command_to_run".
Of course "nobody command_to_run" must be accessable as user nobody and maybe need cd /somewhere/else if it isn't allowed to output in the CWD.

Swift&Smart

07-12-2006 11:11 PM

unSpawn,I need to clarify something.

Please correct me if I am wrong.SUDO is used to do some task which only root can do but use other account than root because of security concern.Is that right?If so,why can't user "nobody" uses command which root can run?How come the command should be accessible by nobody.Isn't it nobody is a substitute as root?

Please tell.:)

uselpa

07-13-2006 01:05 AM

sudo can be configured to allow you to run commands as ANY OTHER user. root is just the most obvious use case, but you can also permit user U1 to run command C1 as user U2, where U2 can be root or nobody or whatever you like.