Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
How to create a admin user on ubuntu

How can I create a superuser in Ubuntu 11.10? I need to create it using the command line.

Either we could change a normal user to become a superuser, or we could create a superuser right away.

share|improve this question

marked as duplicate by Oliver Salzburg, Daniel Beck, slhck, Nifle, techie007 Mar 15 '12 at 0:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

You can create a new user simply using the adduser(8) command.

To make it a user capable of performing sudo, add him to the admin group using either of the following commands:

sudo usermod -a -G admin <username>
sudo adduser <username> admin

This works because the admin group is predefined in /etc/sudoers. Note though that newer versions of Ubuntu will use sudo as group instead:

Until Ubuntu 11.10, the Unix group for administrators with root privileges through sudo had been admin. Starting with Ubuntu 12.04 LTS, it is now sudo, for compatibility with Debian and sudo itself. However, for backwards compatibility, admin group members are still recognized as administrators

For any other customization, refer to the Sudoers documentation.

share|improve this answer
adduser can also add users to groups: adduser <username> <groupname> – Oliver Salzburg Mar 14 '12 at 17:50
Yeah, it's just a nice frontend, you're right :) – slhck Mar 14 '12 at 17:53
Also, to my understanding, there is a slight distinction between the admin and sudo groups (both exist in 11.10), but I don't think I understand it myself. – Oliver Salzburg Mar 14 '12 at 17:55
I thought it was uncommented by default in sudoers but I don't know exactly anymore. – slhck Mar 14 '12 at 18:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.