Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
07-08-2006, 05:14 AM
|
#1
|
Member
Registered: Jan 2003
Location: Hong Kong,China
Distribution: Slackware,OpenSUSE
Posts: 472
Rep:
|
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.
Do you guys have any experience of that one?Please guide.
|
|
|
07-08-2006, 09:41 AM
|
#2
|
Senior Member
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507
Rep:
|
Can you post the output of
Code:
cat /etc/sudoers | grep -v "^[:space:]*#" | grep -v "^[:space:]*$"
please?
|
|
|
07-12-2006, 12:17 PM
|
#3
|
Member
Registered: Jan 2003
Location: Hong Kong,China
Distribution: Slackware,OpenSUSE
Posts: 472
Original Poster
Rep:
|
my terminal responsed with these code:
Quote:
root ALL=(ALL) NOPASSWD:ALL
nobody localhost=(ALL) NOPASSWD:command_which_i_need_to_run
|
Any clue?
|
|
|
07-12-2006, 01:34 PM
|
#4
|
Moderator
Registered: May 2001
Posts: 29,415
|
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.
Last edited by unSpawn; 07-12-2006 at 01:37 PM.
|
|
|
07-13-2006, 12:11 AM
|
#5
|
Member
Registered: Jan 2003
Location: Hong Kong,China
Distribution: Slackware,OpenSUSE
Posts: 472
Original Poster
Rep:
|
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.
|
|
|
07-13-2006, 02:05 AM
|
#6
|
Senior Member
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507
Rep:
|
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 12:56 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|