Life in code, apps and OS's

How to give a standard Ubuntu User full root permissions.

Posted on: January 15, 2007

Granting All(root) Access to Specific Users

You can grant users bob and bunny full access to all privileged commands, with this sudoers entry. (add it to the file: /etc/sudoers). I do not recommend this, however sometimes you may want to achieve this.

bob, bunny  ALL=(ALL) ALL

This is generally not a good idea because this allows bob and bunny to use the su command to grant themselves permanent root privileges thereby bypassing the command logging features of sudo. The example on using aliases in the sudoers file shows how to eliminate this prob.

Granting Access To Specific Users To Specific Files

This entry allows user peter and all the members of the group operator to gain access to all the program files in the /sbin and /usr/sbin directories, plus the privilege of running the command /usr/local/apps/check.pl. Notice how the trailing slash (/) is required to specify a directory location:

peter, %operator ALL= /sbin/, /usr/sbin, /usr/local/apps/check.pl

Notice also that the lack of any username entries within parentheses () after the = sign prevents the users from running the commands automatically masquerading as another user. This is explained further in the next example.

Using syslog To Track All sudo Commands

All sudo commands are logged in the log file /var/log/messages which can be very helpful in determining how user error may have contributed to a problem. All the sudo log entries have the word sudo in them, so you can easily get a thread of commands used by using the grep command to selectively filter the output accordingly.

Here is sample output from a user bob failing to enter their correct sudo password when issuing a command, immediately followed by the successful execution of the command /bin/more sudoers

2 Responses to "How to give a standard Ubuntu User full root permissions."

Can you pls. do an article how the sudoers file really work? I found the help.ubuntu.com version still confusing, you seem kinda get it.

Please do not listen to this. Use ‘visudo’ at the very least. But if it is ubuntu you should simply add them to the sudo group. At least one person I know has locked themselves out with a bad edit.

Leave a comment


  • None
  • How To Dyndns Ubuntu | Order Goods: […] DynDNS Client Setup on Ubuntu | Life in code, apps and OS’s – May 18, 2008  · 7 Responses to "DynDNS Client Setu
  • lizrandolph10886: Wonderful article! We are linking to this particularly great post on our website.nKeep up the great writing. Click
  • waseem Ahmad: Dear. i have a separate application server and a separate mysql database server. when i want to access the application server to login from the local