Computing.Net > Forums > Linux > How To Edit the Sudoers file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

How To Edit the Sudoers file

Reply to Message Icon

Name: n3wo
Date: January 9, 2004 at 07:06:26 Pacific
OS: RH9
CPU/Ram: p3 1ghz 256Mb
Comment:

I want to give ordinary users the ability to mount a device. I was told that I needed to edit the sudoers file. How do I do this? In what way do I need to edit it. I got as far as vi sudoers, but don't know what to do from there.

thanks for your help.



Sponsored Link
Ads by Google

Response Number 1
Name: dieymir
Date: January 9, 2004 at 07:23:34 Pacific
Reply:

You must use a special command 'visudo' to edit your '/etc/sudoers' file. It will start the editor set in the EDITOR environment variable or vi if it doesn't have any value.

Your sudo package should have a very well commented 'sudoers.sample' file, the man page is a mess, specially if you aren't used to BNF notation. The home page of sudo is:
http://www.sudo.ws/

Hope this helps.


0

Response Number 2
Name: n3wo
Date: January 9, 2004 at 10:15:21 Pacific
Reply:

I looked at the sudo file (visudo), but couldn't figure out what to un-comment. (I'm assuming that that is what I should do) I tried the line that says something about users and mount (including cdrom, etc). When I tried to exit (:wq) I got an error "This is a read only. Override with !" So I typed :!wq. I was then told that there were no changes. What am I doing wrong???


0

Response Number 3
Name: JasonR
Date: January 9, 2004 at 10:23:48 Pacific
Reply:

You have to edit the file with root.

or either sudo into root to change the file.


0

Response Number 4
Name: 3Dave
Date: January 12, 2004 at 02:48:24 Pacific
Reply:

You will want to add a line like:
%users ALL=/sbin/mount /mnt/cdrom,/sbin/umount /mnt/cdrom NOPASSWD: ALL


0

Response Number 5
Name: n3wo
Date: January 13, 2004 at 04:29:46 Pacific
Reply:

I tried adding such a line, with /mnt/usb substituted for the cdrom, but I still get the error "mount: only root can do that "

I added
"%users ALL=/sbin/mount /mnt/usb,/sbin/umount /mnt/usb NOPASSWD: ALL
"
all on one line. Do I need tofollow your line changes as well?



0

Related Posts

See More



Response Number 6
Name: 3Dave
Date: January 14, 2004 at 06:40:16 Pacific
Reply:

Nope...it should all be on one line. How are you then trying to use the mount command as a user? It should be:
$ sudo mount /mnt/usb

Another alternative would be to add the "user" flag in /etc/fstab. Have a look at the entry for your cd or floppy drive in /etc/fstab....I am assuming that ordinary users are able to mount a CD?


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: How To Edit the Sudoers file

hai how to copy the file from sys to flo www.computing.net/answers/linux/hai-how-to-copy-the-file-from-sys-to-flo/12519.html

How to edit the main menu in rh8.0 www.computing.net/answers/linux/how-to-edit-the-main-menu-in-rh80/15872.html

In linux how to get the GUI mode www.computing.net/answers/linux/in-linux-how-to-get-the-gui-mode/20746.html