Ubuntu – Nautilus could not create the following required folders

nautilus

I have changed my username and when I did this,I can not log in with my new user and this error comes in the screen: nautilus could not create the following required folders: /home/"last username"/desktop and /home/'last username'/.nautilus .Also when I press CTRL+ALT+F6 for the command line I can not login with my new username. Although I have still access to Linux by root. My Ubuntu version is 11.04 .

Best Answer

You're going to want to log in as root to do this

Firstly, make sure the home folder of your old username does not exist.

ls /home

If you see a folder with your old username, issue the command

mv /home/[oldusername] /home/[newusername]

Then issue the command

usermod -d /home/[newusername] [newusername]
usermod -d /home/[newusername] [oldusername] (just for good measure)

If you still can't log in after this, you'll have to edit the /etc/passwd file

nano /etc/passwd
  1. Find the line that starts with either your old or new username
  2. Make sure the first field is your new username
  3. Make sure the 6th field (after the 5th colon) is your new home directory - /home/[newusername]
  4. Take note of the UID and GID fields (the second and third respectively), this is usually 1000 on single-user systems. If it's not, write it down or remember it. I denote these fields as [UID] and [GID] below.

chown -R [UID]:[GID] /home/[newusername]

Related Question