Adding Users and Creating Home Directory in Ubuntu

So it turns out that if you just issue useradd command in your linux machine you will create a user but there will be no home directory. Th problem the added user will not be able to login in his home directory. He can login using cli but not otherwise. So here is how to create user home directory when adding a user


sudo useradd -d /home/testuser -m testuser

sudo passwd testuser

 

this is a as simple as that and another way is using the adduser command in which you can add more detail for the user like phone number and all.

Advertisements

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