Linux – adding user with home directory and other settings

Add a new user:

useradd -m automation

The -m option would take care of adding a home directory for the user under /home

After adding a new user, I switched to the user and realized that the command prompt looks different. My own user had the command prompt like varun.verma@server-dev:~$ but for the new user, it only showed a $.

I looked through the changes in the /etc directory and found this different in the passwd file:

varun.verma:x:1002:1002:Varun Verma,,,:/home/varun.verma:/bin/bash

I replaced the sh for user automation with bash and that did the trick.


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