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-03-2005, 12:49 AM
|
#1
|
Member
Registered: Aug 2004
Location: BR - Floripa
Distribution: Ubuntu 9.10 - 2.6.x.x
Posts: 661
Rep:
|
Better SUDO explanation
well, I know what sudo does, I know that the conf file of sudo is /etc/sudoers, I know how to add some simple parameter, like allow someone to do something, but I have a litle problem to understand what is exacly the order and the configuration of this file... I know it is very powerfull and full featured command
I have try man sudo, man sudoers, google search for sudoers and sudo, but if you go to the man page of sudo you will see that the explanation of the config file is not the most easy to understand, so Im asking for someone who realy knows edit the sudoers file to explain more about the parameters, or if some one have a realy good link about it, not like the manual...
thanks!
|
|
|
07-03-2005, 01:05 AM
|
#2
|
Member
Registered: Mar 2005
Location: Chicago
Distribution: Gentoo AMD64
Posts: 365
Rep:
|
You should use the command "visudo" to modify the sudo list. Check the visudo man page.
Last edited by juanbobo; 07-03-2005 at 01:07 AM.
|
|
|
07-03-2005, 01:24 AM
|
#3
|
Member
Registered: Aug 2004
Location: BR - Floripa
Distribution: Ubuntu 9.10 - 2.6.x.x
Posts: 661
Original Poster
Rep:
|
visudo will just open /etc/sudoers in vipw, so its the same thing if you use mc, pico, vim, gedit, kedit or what you prefer, visudo is just a specification that can be done to always open sudoers in an specific text editor...
And there is some things that it does like dont allow more than one user to edit the file, dont save it with parser errors and things that dont help me in no way...
But like I said, what I want is some better manual of sudoers. Anyone?
Last edited by maginotjr; 07-03-2005 at 01:27 AM.
|
|
|
07-03-2005, 02:12 AM
|
#4
|
Member
Registered: Mar 2005
Location: Chicago
Distribution: Gentoo AMD64
Posts: 365
Rep:
|
"visudo edits the sudoers file in a safe fashion, analogous to vipw(8). visudo locks the sudoers file against multiple simultaneous edits, provides basic sanity checks, and checks for parse errors. If the sudoers file is currently being edited you will receive a message to try again later."
Here is sudo guide that may help:
http://www.linuxhelp.ca/guides/sudo/
Last edited by juanbobo; 07-03-2005 at 02:16 AM.
|
|
|
07-03-2005, 02:05 PM
|
#5
|
Member
Registered: Aug 2004
Location: BR - Floripa
Distribution: Ubuntu 9.10 - 2.6.x.x
Posts: 661
Original Poster
Rep:
|
yeah, I know, but to edit sudoers file with visudo you need to know what put in SUDOERS and this is what I want ... I will give a look at the link, thks!
|
|
|
07-03-2005, 02:31 PM
|
#6
|
Member
Registered: Aug 2004
Location: BR - Floripa
Distribution: Ubuntu 9.10 - 2.6.x.x
Posts: 661
Original Poster
Rep:
|
okay, what is in this file I have knoledge, what I really want to know is how to set the flags to some commands....
PASSWD, ROOTPW, NOPASSWD this kind of thing
|
|
|
07-03-2005, 07:38 PM
|
#7
|
Member
Registered: Jul 2004
Distribution: Void Linux, former Slackware
Posts: 498
Rep: 
|
If I remember correctly, these flags can be inserted in front of commands so
maginotjr myhost=(root) NOPASSWD: /sbin/makepkg, /usr/sbin/pppd PASSWD: /usr/sbin/fbset ROOTPW:/sbin/modprobe
entry should mean user maginotjr on computer myhost can run as root makepkg and pppd without password, fbset by typing his own password and modprobe by inserting root password.
I cann't find much benefits of sudo so I'm not using it and cann't background with my own experience.
Besides man pages you should find tons of examples and howtos simply with Google.
|
|
|
07-03-2005, 11:07 PM
|
#8
|
Member
Registered: Aug 2004
Location: BR - Floripa
Distribution: Ubuntu 9.10 - 2.6.x.x
Posts: 661
Original Poster
Rep:
|
I use sudo to run a command to connect to the adsl connection of my office, so it is an icon in my panel, but adsl-connect have only root permission to be run so I have enable NOPASSWD:/usr/sbin/adsl-start so I can just click on the icon and connect without needing to give the password, but I want to learn better about sudo flags, one of them is ROOTPW, I have tryed what you said and it returns an error... ://
|
|
|
07-04-2005, 05:22 AM
|
#9
|
Member
Registered: Jul 2004
Distribution: Void Linux, former Slackware
Posts: 498
Rep: 
|
Heh, ROOTPW is not a tag to commands like PASSWD and NOPASSWD are but it is a flag to change default configuration options and has to be written in lowercase. It changes whether for password-required commands it'll except user's or root's password.
After a brief man page reading I assume it's not possible to mix authentications with both passwords.
My previous example may look like:
Defaults:maginotjr rootpw
maginotjr myhost=(root) NOPASSWD: /sbin/makepkg, /usr/sbin/pppd PASSWD: /usr/sbin/fbset /sbin/modprobe
and for user maginotjr sudo fbset and sudo modprobe will require a root password.
In the other case:
Defaults !rootpw
maginotjr myhost=(root) NOPASSWD: /sbin/makepkg, /usr/sbin/pppd PASSWD: /usr/sbin/fbset /sbin/modprobe
entries mean for all users including maginotjr are password protected commands authenticated against own user's password. This should be the default behaviour.
|
|
|
07-04-2005, 01:59 PM
|
#10
|
Member
Registered: Aug 2004
Location: BR - Floripa
Distribution: Ubuntu 9.10 - 2.6.x.x
Posts: 661
Original Poster
Rep:
|
now it works great!
thanks for the help! Now I will try take from here
Regards!

|
|
|
All times are GMT -5. The time now is 09:39 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
|
|