LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   sudo permission denied (https://www.linuxquestions.org/questions/slackware-14/sudo-permission-denied-462024/)

Swift&Smart 07-08-2006 04:14 AM

sudo permission denied
 
Hello,everyone.:)

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:

Do you guys have any experience of that one?Please guide.

uselpa 07-08-2006 08:41 AM

Can you post the output of
Code:

cat /etc/sudoers | grep -v "^[:space:]*#" | grep -v "^[:space:]*$"
please?

Swift&Smart 07-12-2006 11:17 AM

my terminal responsed with these code:

Quote:

root ALL=(ALL) NOPASSWD:ALL
nobody localhost=(ALL) NOPASSWD:command_which_i_need_to_run
Any clue?

unSpawn 07-12-2006 12:34 PM

Try using an unprivileged account with UID >= 500 (/etc/login.defs default):
Code:

swiftsmart localhost=(ALL) NOPASSWD: (nobody) command_to_run
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.


All times are GMT -5. The time now is 04:28 PM.