Can't login into second user account

I made a fresh install of Manjaro from LiveISO, but kept both /home directories intact
Before the re-install there were 2 user account present:

  • user1 (admin, everything works fine)
  • user2
    In post-install, logged in as user1, I created a new account with:
# useradd -m user2
# passwd user2

I log out from user1, but I can’t log in to user2 desktop.
What am I doing wrong? I tried the same vie GUI, but it’s the same.

Hello @Skydancer.

Did you run:


sudo useradd -m user2
sudo passwd user2


And was the home directory for ‘user2’ created?

@kisun I ran

sudo useradd -m user2
sudo passwd user2

Home directory for user2 had been created before I ran those commands, because it is an old home directory that user2 used before I re-installed Manjaro.

if you run

ls -la /home

does it show the right username as owner for ‘user2’?

If you take a look at ‘/etc/passwd’ there you can see the userIDs and groupIDs for every user. And files/directorys are marked with these IDs as owner, not with the username.

Are you sure that the userID in ‘/etc/passwd’ is the same as in your old installation. UserIDs for normal users start at 1000 and are count up with every new user.
Also in ‘/etc/passwd’ you can see which home-directory is set for every user.

For simple you can try to rename/backup the old user2-folder, then delete user2, add user2 again with a fresh home-directory and try to login. If login works copy back the files from the old user2-folder and run 'chown -R’ for the new user. :grinning:

@kisun thanks!
It was so simple. It was an ownership problem. /home/user2 was owned by user1.
I just ran:

sudo chown -R user2:user2 /home/user2

and the problem was fixed.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.