Home > ubuntu > Add a user in Ubuntu and change the UID and GID

Add a user in Ubuntu and change the UID and GID

To add a user with a specified home folder:


$ sudo useradd -d /home/rosa -m <username>

With -d we set the home folder of the user and with -m we force the creation of that folder.

Then we can set the password for that user:


$ sudo passwd <username>

To change the UID of the user (starts with 1000, 1001, etc.):


$ sudo usermod -u 1002 -U <username>

And to change the GID of the group:


$ sudo groupmod -g 1002 <groupname>

Advertisements
Categories: ubuntu Tags: , , , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: