Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

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.