Locked out of your Linux Session

Funny enough I was unable to log into my Linux (Ubuntu) session and I realized this might be a more common problem that it seemed. So, if you keep getting redirected to the login screen after typing your correct password over and over (and over and over), there’s no need to panic.

This usually has to do with the .Xauthority file, so from the login page press Ctrl+Alt+F1 which will bring you to the command line where you can login with your usual credentials. Once logged in, search for the .Xauthority file and check that it is owned by you and not the root

ls -l ~/.Xauthority 
-rw------ 1 root root 1 feb 11 13:13 /home/joaquin/.Xauthority

Use the following command to change ownership

chown group:username ~/.Xauthority

in my case both group and username are joaquin. You may need to ‘sudo’ it. If that doesn’t work try deleting the file altogether, upon login it will be created again.

rm -rf ~/.Xauthority

In any case, if any of these solutions worked, press Ctrl+Alt+F7 to go back to the login screen and now you should be able to get in.

These solutions are quite straightfoward but if the problem persist you may need to update the system or downright install it again from the command line we opened at the begining.

About joaquinbarroso

Theoretical chemist in his early forties, in love with life and deeply in love with his woman and children. I love science, baseball, literature, movies (perhaps even in that order). I'm passionate about food and lately wines have become a major hobby. In a nutshell I'm filled with regrets but also with hope, and that is called "living".

Posted on February 11, 2020, in Computational Chemistry and tagged , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: