Server Fault is a question and answer site for system and network administrators. 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

How can I create users with privilege in ubuntu 10.04 server by using CLI

share|improve this question
up vote 2 down vote accepted

Create a (normal) user:

sudo adduser

Give user sudo rights. Default all admin users can sudo, so you can just move your new user into that group.

sudo usermod -a -G admin my_new_user

Or add it manually do the sudoers file (/etc/sudoers)

sudo visudo

And add

my_new_user    ALL=(ALL) ALL
share|improve this answer

I guess you are talking about being able to run sudo and stuff like that. Well for that to happen you have to belong to the admin group.

In order to keep this user as similar to another ubuntu user as possible the full command would be:

sudo groupadd foo
sudo useradd foo -g foo -G 'adm,disk,dialout,cdrom,plugdev,lpadmin,admin' -m

The most important one here is 'admin' as that would allow the user to run sudo which is probably what you want.

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.