Setting up user to use sudo for specific commands
So I did some digging on the sudo command and I do know the config file is /etc/sudoers
Read the manual for sudoers and found out that I must use visudo to edit the file I read some of the examples at the bottom of the file and tried entering my own account in following the example. one of the commands I was trying to allow my account to perform without root login is the mount command So I tried adding this in (kreid8 /bin/mount ALL) I then saved & exited the file and logged out of root and tried sudo mount -t vfat /dev/sdc1 /media. I got an error saying I had to be root in order to do that But when I use the visudo -l option it shows that I have that privellege. Did I edit the file incorrectly? Thanks in advance to all those who reply with help |
Simple example
At a very simplistic level, you can add this to your /etc/sudoers file
user ALL=(root) NOPASSWD: /bin/mount Where "user" is the user name. Additional commands can be added with commas user ALL=(root) NOPASSWD: /bin/mount,/bin/umount That should get you started anyway! :D |
Great thanks a lot!! :D
|
Using the "user" or "users" mount option in /etc/fstab will also allow a regular user to mount that filesystem.
|
I had to create another user and allow him to use sudo for my own account (kreid8)
So how would I go about doing that, because I do not want to give root commands to this user I just want sudo tail and head to work from the new user using my account |
Given the example above, and "man sudoers" you should be
able to figure that one out yourself, really ;} |
Quote:
I had a problem with this when I set up my new Debian distro yesterday. Here's what the bottom part of my sudoers file looks like: # Uncomment to allow members of group sudo to not need a password # %sudo ALL=NOPASSWD: ALL # Host alias specification # User alias specification # Cmnd alias specification # User privilege specification root ALL=(ALL) ALL myusername ALL=NOPASSWD:ALL To get to the file you should always use the command $ visudo After (carefully) making the changes use ctrl+x then y to leave and when asked what to do type Q and hit enter. This will save the changes you made. Test sudo with something simple. HTH. |
All times are GMT -5. The time now is 10:37 PM. |