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
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.
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
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?
Summary: OK then, not sure if I know exaclty what you want to do but here goes... You can drag and drop files just like windows, you can also type: #cp /location/of/file /destination/to/copy/to If you are talk...
Summary: If you want to edit the menu in rh8.0, you can open "/usr/share/applications" with your console.In this dir, there are a lot of *.desktop files. Study it carefully, and you will find the right way to ...
Summary: Open up /etc/inittab with an editor of some sort. A few lines down in that file, you will see something similar to the following: ************ # These are the default runlevels in Slackware: # 0 = ...