Ubuntu – Can I have a user execute sudo commands without being an administrator?


Possible Duplicate:
How do I add a user to the “sudo” group?

I recently became a UNIX admin for some relatives, and they are quite far up the creek on how to use ubuntu. I know that one key to UNIX administration is not to use the Admin account as little as possible, which I'm trying to enforce on their machine. I've looked at other articles regarding this, but they do the easy way out – changing the account to Administrator. That is changing the permissions completely. I want my standard user account to be able to execute sudo commands, but not be an administrator account. Thank you in advance for any help.

Best Answer

  • Ubuntu has taken care of these issues for you, you don't need to worry about the Standard user or even the Administrator using the Super User priviledges all the time. In order to be able to use the sudo command, the Standard User needs to be listed in the /etc/sudoers file; the Administrator is automatically listed in this file. To add a user to this file, type the following command at the terminal:

    sudo nano /etc/sudoers

    You will see the following lines:

    %sudo ALL=(ALL:ALL) ALL

    Just add the name of the user who is to be able to use the sudo priviledges below these lines. To save the file, press Ctrl + o and to exit, press Ctrl + x.
    Unless the user is listed here, she won't be able to use the sudo command, and it will return the error "The user"(the user name) is not listed in the sudoers list. This incident will be reported.

  • Related Question