Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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 am unable to login through GUI as a user but I am able to login via terminal.

This occurred after I installed 2 steps authenticator of Google using apt-get install command. I followed these steps:

  1. sudo apt-get install libpam-google-authenticator

  2. Edited /etc/pam.d/sshd and add the following line to the file:

    auth required
  3. Edited /etc/ssh/sshd_config and changed ChallengeResponseAuthentication to yes

  4. I restarted the ssh service.

    root@george:~# ls -l /home/george/.Xauthority  
    -rw------- 1 root root 125 Jan 31 19:35 /home/george/.Xauthority
share|improve this question
log-in via terminal & type ls -l /home/user/.Xauthority.. change it to your username instead of user. Please post the output of that line by editing your question. – AzkerM Feb 4 '14 at 10:51

Well, by the look of your output for ls -l /home/user/.Xauthority shows that the file is owned by root where it is supposed to be user. In your case, it should be george. Moving the file or giving permission to its origin user would fix if I'm not mistaken. Anyhow, please follow below steps by logging in via terminal;

  • Log in as the user (as goerge) & change to the user's home directory
cd /home/user                 # in your case, its /home/george

or even a single cd ~ command will take you directly to the home folder of the user.

  • I do not recommend deleting or changing ownership at first, so let us move it by backing-up
sudo mv .Xauthority .XauthorityBak
  • And then reboot your system.
sudo reboot

P.S.: There are instance where this may work to get your problem fixed or may not. Since you're not deleting the original .Xauthority file it won't be a harm.

Source: Lost gui after ending xorg process

share|improve this answer
Azker Mohamed its worked for me thank you very much – George Ulahannan Feb 6 '14 at 3:44
@user237793 I'm glad it helped you. And, please accept it as answer if it helped you. This will also reduce the question queue. :) – AzkerM Feb 6 '14 at 5:32

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.