LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-03-2005, 12:49 AM   #1
maginotjr
Member
 
Registered: Aug 2004
Location: BR - Floripa
Distribution: Ubuntu 9.10 - 2.6.x.x
Posts: 661

Rep: Reputation: 35
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!
 
Old 07-03-2005, 01:05 AM   #2
juanbobo
Member
 
Registered: Mar 2005
Location: Chicago
Distribution: Gentoo AMD64
Posts: 365

Rep: Reputation: 30
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.
 
Old 07-03-2005, 01:24 AM   #3
maginotjr
Member
 
Registered: Aug 2004
Location: BR - Floripa
Distribution: Ubuntu 9.10 - 2.6.x.x
Posts: 661

Original Poster
Rep: Reputation: 35
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.
 
Old 07-03-2005, 02:12 AM   #4
juanbobo
Member
 
Registered: Mar 2005
Location: Chicago
Distribution: Gentoo AMD64
Posts: 365

Rep: Reputation: 30
"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.
 
Old 07-03-2005, 02:05 PM   #5
maginotjr
Member
 
Registered: Aug 2004
Location: BR - Floripa
Distribution: Ubuntu 9.10 - 2.6.x.x
Posts: 661

Original Poster
Rep: Reputation: 35
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!
 
Old 07-03-2005, 02:31 PM   #6
maginotjr
Member
 
Registered: Aug 2004
Location: BR - Floripa
Distribution: Ubuntu 9.10 - 2.6.x.x
Posts: 661

Original Poster
Rep: Reputation: 35
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
 
Old 07-03-2005, 07:38 PM   #7
dunric
Member
 
Registered: Jul 2004
Distribution: Void Linux, former Slackware
Posts: 498

Rep: Reputation: 100Reputation: 100
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.
 
Old 07-03-2005, 11:07 PM   #8
maginotjr
Member
 
Registered: Aug 2004
Location: BR - Floripa
Distribution: Ubuntu 9.10 - 2.6.x.x
Posts: 661

Original Poster
Rep: Reputation: 35
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... ://
 
Old 07-04-2005, 05:22 AM   #9
dunric
Member
 
Registered: Jul 2004
Distribution: Void Linux, former Slackware
Posts: 498

Rep: Reputation: 100Reputation: 100
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.
 
Old 07-04-2005, 01:59 PM   #10
maginotjr
Member
 
Registered: Aug 2004
Location: BR - Floripa
Distribution: Ubuntu 9.10 - 2.6.x.x
Posts: 661

Original Poster
Rep: Reputation: 35
now it works great!

thanks for the help! Now I will try take from here

Regards!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Restricting Editing in Sudo (Advanced Sudo Question) LinuxGeek Linux - Software 4 11-04-2006 03:20 PM
Explanation of a phenomenon n3tw0rk Linux - Networking 1 11-10-2004 01:21 PM
explanation on typedef naren Programming 5 03-09-2004 10:48 PM
Explanation or some links.. sh0cker Linux - General 2 02-12-2004 10:19 PM
I Could Use An Explanation winger Linux - General 3 04-13-2002 10:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration