Editing the sudoers file
I know I need to use visudo to modify the sudoers file. However, I want to make commands for sudo as root.
I wanted to use the command userdel. How do I go about managing this? |
Are you the only sudo user on your system. If so, then simply make yourself a member of the wheel group and then uncomment the line in visudo top allow members of wheel to use sudo. You can run any command then as root.
If there are other admin users and you want to restrict the commands that can be run, there is a sample cdrom mounting example you can modify to allow using the userdel command. Code:
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom There is one gotha to be aware of. You sometimes need to log out after modifying sudo or especially if you add yourself to a group. Group membership is read when you start a new session. |
I have many users on the system. I need to configure sudo commands as root for only one specific user. Would the syntax look something like this?
*for instance assume the user is bob and i want to use the ifconfig command: bob ALL=(ALL) ALL ifconfig=/sbin/ifconfig |
Try "man sudoers" - plenty of doco in there.
|
Generally, you just need to add users authorized to use sudo to the `wheel' group and then uncomment the line that let's members of the wheel group use sudo.
|
All times are GMT -5. The time now is 06:47 PM. |