Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I had 4 accounts on UBuntu 11.10. The /home folder is in a separate partition. Now, after I reinstalled Ubuntu 12.04 beta 2, I manually created the remaining 3 usernames so that it can use the existing home locations. However, after creating the users i found that the usernames have got mapped to the other home folders. For example

user A got mapped to home folder of user B User B got mapped to home folder of user C User C got mapped to home folder of user A

How do I change this so that the users get mapped to their correct account.

share|improve this question
up vote 2 down vote accepted

You mixed up the numeric userid's.

First of all check the current configuration: grep -E [0-9]{4} /etc/passwd You might want to check if the username (1st field) has the correct homedir (6th field).

If the passwd file is as expected: Check the output for id for every account and compare it with ls -ln /home.

Probably the easiest way to change it is as follows:

  • Log off from your desktop
  • Strike Alt+F1 and log in

    sudo -i cd /home chown -R userid2:userid2 userid2 chown -R userid3:userid3 userid3 ...

  • Strike Alt+F2

  • Check if you can log in without errors

  • Strike Alt+F7

  • Check if you can log in to your desktop without problems

You might want to wait with your first user (the one with admin privileges), to make sure if the procedure works as expected. Prevent locking yourself out.

share|improve this answer
Thanks. I managed to fix it. however, 1 of the 4 does not log in to the desktop. It comes back to the LightDM login screen. Others login fine. Also, I can login to all the users properly using the terminal. – Ubuntuser Apr 14 '12 at 12:23
Try login with the problem user from a text console Alt+F1 en see what error you get. You probably made a mistake with numeric uid's. You should also be able to check ls -l /home which should show no numeric UID's. – jippie Apr 14 '12 at 12:28

unix/linux systems identify users by user ID. You can 'sudo vipw' to switch the uid in password file so they match properly with the user names

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.