Adding Users in Ubuntu

1. adduser
sudo adduser john
Prompts for each piece of information(password, home dir etc)

To create/assign admin/sudoer:
sudo adduser john admin
If john already exists, it assigns admin/sudoer privilege to john. This works because /etc/sudoers is pre-configured to grant permissions to all members of this group.

2. useradd
sudo useradd john
Adds user without any extra options. User won’t have a password or a home directory.
To create user with home dir:
sudo useradd -d /home/john -m john
To change password:
sudo passwd john

Check man pages of adduser and useradd for additional options.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s