Problem with sudo
I wanna use sudo, to give alumno03 and grupo soparcial permission to use groupadd and useradd. I edit sudoers like this :
# sudoers file. # # This file MUST be edited with the 'visudo' command as root. # # See the sudoers man page for the details on how to write a sudoers file. # # Host alias specification # User alias specification # Cmnd alias specification # Defaults specification # User privilege specification root ALL=(ALL) ALL alumno03 ALL=/usr/sbin/groupadd # Uncomment to allow people in group wheel to run all commands %laboratorios ALL=(ALL) ALL # Same thing without a password # %laboratorios ALL=(ALL) NOPASSWD: ALL # Samples #%laboratorios ALL=/usr/sbin/useradd,/usr/sbin/groupadd,/usr/sbin/passwd # %users localhost=/sbin/shutdown -h now BUT when I use alumno03 --> alumno03# sudo groupadd group1 I got this message --> Can not lock /etc/group What is wrong here Thanks |
s
|
Re: Problem with sudo
Quote:
|
I'm just going to jump is and say that it doesn't. I don't like the feel of vi at all and I've edited /etc/sudoers and made successful changes plenty of times with nano.
|
Ooh, such a bad idea.
Read carefully: This file MUST be edited with the 'visudo' command as root. If you don't like vi, it's quite simple - change the environment variable EDITOR: under bash, you can type "declare EDITOR=nano", or whatever you like, then go ahead and use visudo! |
From man visudo:
Quote:
Here's an example of how to give a user root access to run only a particular command using sudo: Code:
alumno03 ALL=(ALL) NOPASSWD: /usr/sbin/groupadd |
All times are GMT -5. The time now is 04:15 AM. |