1

I just created an account with name rashmi and set its password. Then I restarted my system. When I log in to rashmi another screen appears for less than a second and then vanish and again the login screen comes back. So I am not able to login in to Ubuntu from the newly created user

I created my user with sudo useradd rashmi, then set its password using sudo passwd rashmi.

Can anyone please tell me how to log in as a new user and where I am going wrong?

1 Answer 1

0

By default useradd simply creates the user account and group in the /etc/passwd and /etc/group files. It does not create a home directory for the new user. Instead run the sudo adduser username command, which will prompt for extra information including password, full name, etc. and then create a home directory which will be populated from default information in /etc/skel.

To fix this, you have two options. The simplest would be to run sudo userdel rashmi, and then start again with the adduser command, or you could manually create the home directory as root user, and change the ownership of the copied files to match that of the new user:

ls /home/rashmi

Confirm that there is no data about to be overwritten. Then

sudo cp -a /etc/skel /home/rashmi
sudo chown -R rashmi:rashmi /home/rashmi

I recommend using the first method if possible, as it will add a usergroup for the new user, which you may not have done yet (you can do this manually by editing the /etc/group file as the root user).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .