Locked out of Ubuntu: 'session only lasted 10 seconds'

Q When I try to log into my newly-installed Ubuntu I get a message saying: 'Session only lasted 10 seconds'. When I check the log I see:

'Failed to set permission 700 to .gnome2_private'.

I can only log in to a terminal, so how do I fix this?

A Are you reusing a home directory from another distro? What you describe is a classic symptom of that. Even though you may have used the same username as on your old system when installing Ubuntu, the username and group could have been allocated different numerical values (usually referred to as UID and GID). The filesystem only stores the numerical values, so these files are no longer owned by your user, hence the error when trying to change the attributes of one of them. Fortunately, the solution is simple and fairly quick. At the terminal prompt, type

sudo chown -R fred: ~fred

This resets everything in Fred's home directory to be owned by Fred. The string needs to be run as root, hence the use of sudo. The trailing colon after the username, which you will obviously replace with your own, is important - it sets the GID to whichever group Fred belongs to, his primary group. Not only is this quicker than running chgrp, it even saves you from having to look up the correct group.

Follow us on Identi.ca or Twitter

Username:   Password: