Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have run the following commands:

sudo groupadd -r testgroup
sudo useradd -g testgroup -M -r testuser

Notice the -r option, which according to the man page:

    Create a system account.

Assuming I have a user account with root privileges, I then run:

sudo -u testuser cat /dev/input/mouse0

However, I get:

cat: /dev/input/mouse0: Permission denied

Running the same command as root provides the expected output (garbled output from the mouse driver).

How can I create a user with root privileges?

share|improve this question
possible duplicate of How can I add a new user as sudoer using the command line? – BuZZ-dEE Mar 13 '15 at 13:31
up vote 17 down vote accepted

Haven't tried it but this should create a new user and add them to the sudo group, which if your /etc/sudoers is as default, should mean they're allowed to use sudo with their password (just like the standard first user):

sudo adduser --group sudo newusername

If you've already created the user, you can just run:

sudo adduser existing_user sudo

man adduser will show you some of the other billion permutations and combinations of arguments this tool has.

Note: If you use Ubuntu 11.10 or older, you should use the admin group instead of sudo.

share|improve this answer
Ah... no wonder it wasn't working. – Nathan Osman Mar 31 '11 at 0:11
For 12.04 (Precise) and newer: The default group for root privileges is sudo but admin will work too. However, new installs won't have the admin group created at all. – papukaija Dec 27 '12 at 0:29
On Ubuntu 14.04 I get adduser: Specify only one name in this mode. when executing sudo adduser --group sudo ubuntu – Yura Jul 30 '14 at 17:39
Also on Ubuntu 12.04.5 LTS it does not work. – BuZZ-dEE Mar 13 '15 at 11:00

I found some sites where they do the: sudo adduser paul admin

but my linux does not have the admin group so I use:

sudo adduser paul sudo
share|improve this answer

"System account" just means that the user will get an UID (user identifier) from a reserved range, it doesn't give any extra permissions. The right way to elavate privileges is to use sudo, as described by Oli.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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