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. |
Can you post the output of
Code:
cat /etc/sudoers | grep -v "^[:space:]*#" | grep -v "^[:space:]*$" |
my terminal responsed with these code:
Quote:
|
Try using an unprivileged account with UID >= 500 (/etc/login.defs default):
Code:
swiftsmart localhost=(ALL) NOPASSWD: (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. |
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.:) |
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. |