How to add a new user to sudoers in Ubuntu


How to add a new user as sudoer in Ubuntu using terminal

In (Precise Pangolin, 12.04) the terminal , type

sudo adduser [newusername] sudo

change [newusername] with name of the new user.

Ex :- (This command will add a new user john to sudo group)

$ sudo adduser john sudo

If you are using previous version of Ubuntu, use the following command.

sudo adduser [newusername] admin

This change will work next time the user logs in.

To add a new user to sudo,

  1. From the System->Administration menu, open Users and Groups tool.
  2. Then click on the user and choose properties.
  3. Then choose the User Privileges tab. In the tab, find Administer the system and check that.
  • In Ubuntu 8.04 LTS (code name for Hardy Heron) and newer version, you need to Unlock first, then you can select a user from the list and press Properties.  Then select the User Privileges tab -> check Administer the system.

How to add a regular user to the sudoers file

Edit the file /etc/sudoers. But use /usr/sbin/visudo  as your editor.

sudo /usr/sbin/visudo

Source : Allowing other users to run sudo

5:32 pm