LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-15-2015, 08:34 AM   #1
Entropy1024
Member
 
Registered: Dec 2012
Location: UK
Distribution: Ubuntu 16 & 17
Posts: 131

Rep: Reputation: Disabled
Can't log in via GUI. Suspect .Xauthority issue


I have had Ubuntu 15.04 running for a week or so fine now. Most of the time I have been accessing it remotely with TeamSeer. All good.

Today I went to log in and no joy, it could not be found. I went to the PC physically and had a look, it was sitting on the login screen, so logged in, all fine for about 10 seconds or so then it kicked me out back to the login screen!
I could log back in fine, however after a few seconds it logged me out again. I could get in via the guest account and that was fine, I was not kicked out.

After reading about this I saw someone say they had a similar issue and it was a corrupted .Xauthority file. They fixed the issue by deleting it and the system auto created a new one.

So I deleted the .Xauthority file via the tty (CTRL+ALT+F1) and now I can't log in at all via the GUI. I can still get in via tty however I can't see a .Xauthority file in my home directory. Yes, I am using the -a modifier.

So my question is how do I recover from this? How do I create a new .Xauthority file?

Many thanks for any help
Tim
 
Old 10-15-2015, 08:43 AM   #2
cynwulf
Senior Member
 
Registered: Apr 2005
Posts: 2,727

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
Removing any Xauth files with the X session running for the logged in user causes bad things to happen.

You need to log out, switch to a vt, rm any stale .Xauthority and .serverauth.* files and then log back in. The display manager can be running, as you're only working with a specific user's dotfiles.
 
Old 10-15-2015, 08:55 AM   #3
Entropy1024
Member
 
Registered: Dec 2012
Location: UK
Distribution: Ubuntu 16 & 17
Posts: 131

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by cynwulf View Post
Removing any Xauth files with the X session running for the logged in user causes bad things to happen.

You need to log out, switch to a vt, rm any stale .Xauthority and .serverauth.* files and then log back in. The display manager can be running, as you're only working with a specific user's dotfiles.
Thanks for the reply.

Unfortunately I am very new to Linux and I'm not sure how exactly to do the above.
  1. When you say switch to a vt is this not the tty via CTRL+ALT+F1?
  2. I have removed the .Xauthority already using the rm command, I can do the same with the .serverauth.* files, where are they stored?
  3. After I do this will I not be left without the .Xauthority file again & possibly also missing these .serverauth.* files?

Regards
Tim
 
Old 10-15-2015, 11:12 AM   #4
cynwulf
Senior Member
 
Registered: Apr 2005
Posts: 2,727

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
Quote:
Originally Posted by Entropy1024 View Post
Thanks for the reply.

Unfortunately I am very new to Linux and I'm not sure how exactly to do the above.


When you say switch to a vt is this not the tty via CTRL+ALT+F1?
Yes that's it. vt is "virtual terminal". You will have terminals on at least F1 to (I think) F6 on Linux and maybe more less on other *nix. (it's not set in stone and depends on whoever set up your distribution really).
Quote:
Originally Posted by Entropy1024 View Post
I have removed the .Xauthority already using the rm command, I can do the same with the .serverauth.* files, where are they stored?
The dotfiles are in your user's $HOME directory. Try the following:

1) Log out first - so get back to where you see the display manager logon screen (or boot the system and don't login from the display manager).

2) Switch to any vt (so yes CTRL+ALT+F1) and login as your normal user (i.e. the user with the problem).

3) -
Code:
$ cd ~
$ rm .Xauth*
$ rm .serverauth.*
CTRL+D

4) Switch back to the X server usually CTRL+ALT+F7 but not necessarily (see above)

5) Login and see if that fixes it.

Quote:
Originally Posted by Entropy1024 View Post
After I do this will I not be left without the .Xauthority file again & possibly also missing these .serverauth.* files?

Regards
Tim
As soon as you login from the display manager the Xauth session files will be regenerated (normal) for the current session. This is required to solve the problem.

Last edited by cynwulf; 10-15-2015 at 11:15 AM.
 
Old 10-15-2015, 11:21 AM   #5
Entropy1024
Member
 
Registered: Dec 2012
Location: UK
Distribution: Ubuntu 16 & 17
Posts: 131

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by cynwulf View Post
Yes that's it. vt is "virtual terminal". You will have terminals on at least F1 to (I think) F6 on Linux and maybe more less on other *nix. (it's not set in stone and depends on whoever set up your distribution really).

The dotfiles are in your user's $HOME directory. Try the following:

1) Log out first - so get back to where you see the display manager logon screen (or boot the system and don't login from the display manager).

2) Switch to any vt (so yes CTRL+ALT+F1) and login as your normal user (i.e. the user with the problem).

3) -
Code:
$ cd ~
$ rm .Xauth*
$ rm .serverauth.*
CTRL+D

4) Switch back to the X server usually CTRL+ALT+F7 but not necessarily (see above)

5) Login and see if that fixes it.


As soon as you login from the display manager the Xauth session files will be regenerated (normal) for the current session. This is required to solve the problem.
OK I just trued that and both the rm commands resulted in a file not found error.
I logged back on using the GUI and as before I got a black screen for a few seconds then back to the GUI log in screen.

Is there anything else I can try?

Thanks again for the help with this issue.
Tim
 
Old 10-15-2015, 11:26 AM   #6
cynwulf
Senior Member
 
Registered: Apr 2005
Posts: 2,727

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
You need to be in your user's home directory to find those. Also file names are case sensitive. Removing those does no harm by the way. X.org creates and removes those files when it starts/stops. Ensure that you have removed them. i.e. enter your home directory and
Code:
$ ls -al
and visibly check they are not there.
 
Old 10-15-2015, 11:46 AM   #7
Entropy1024
Member
 
Registered: Dec 2012
Location: UK
Distribution: Ubuntu 16 & 17
Posts: 131

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by cynwulf View Post
You need to be in your user's home directory to find those. Also file names are case sensitive. Removing those does no harm by the way. X.org creates and removes those files when it starts/stops. Ensure that you have removed them. i.e. enter your home directory and
Code:
$ ls -al
and visibly check they are not there.
Yes I'm in my home directory. That's what the CD ~ command does right?

When I do the remove command it does not find these files, strongly suggesting they have gone. I have entered the case correctly BTW. Therefore these files simply do not exist in my home directory.
This is confirmed if I do the ls - al command. Ie other files and directories of mine from the home folder such as documents, pictures, videos etc are present. So I'm confident I'm in the correct directory.

I don't think the issue is that I have not deleted the aforementioned files A directory listing of all files including hidden ones does not show them. Using rm results in an error saying they can't be found. They are not there.

As I understand it the system should detect they are missing and generate new ones yes? If so why is this not happy happening is the question.

Cheers
Tim
 
Old 10-15-2015, 03:50 PM   #8
cynwulf
Senior Member
 
Registered: Apr 2005
Posts: 2,727

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
I've mentioned case specifically as you have not differentiated even in the latest post.

I suggest having a look at error logs next.

The ones to look at first are ~/.xsession-errors and /var/log/Xorg.0.log

Warnings and errors in the latter are indicated by "WW" and "EE" respectively. It's worth looking as it might pinpoint the problem exactly.
 
Old 10-15-2015, 04:27 PM   #9
Entropy1024
Member
 
Registered: Dec 2012
Location: UK
Distribution: Ubuntu 16 & 17
Posts: 131

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by cynwulf View Post
I've mentioned case specifically as you have not differentiated even in the latest post.

I suggest having a look at error logs next.

The ones to look at first are ~/.xsession-errors and /var/log/Xorg.0.log

Warnings and errors in the latter are indicated by "WW" and "EE" respectively. It's worth looking as it might pinpoint the problem exactly.
I will take a look at the logs and see what they say. Thanks.

I don't believe I have ever mixed up the case. I am CERTAIN that there are no .Xauthority or .serverauth.* in any combination of case in my home directory, and I suspect that is why I can't get the GUI to work.

Reading about these files they appear to be integral to the GUI working. I need to find some way to replace these files. I asked before if the system should automatically replace these critical files, do you know if it should? You asked me to delete them which I did, but missed the part about getting them back.

How do I create a new .Xauthority file? I have tried 'transplanting' one from another Ubuntu 15.04 system I have, however this did not work and I suspect they may be unique for each install.

Regards
Tim
 
Old 10-15-2015, 05:20 PM   #10
cynwulf
Senior Member
 
Registered: Apr 2005
Posts: 2,727

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
Quote:
Originally Posted by Entropy1024 View Post
Reading about these files they appear to be integral to the GUI working. I need to find some way to replace these files. I asked before if the system should automatically replace these critical files, do you know if it should? You asked me to delete them which I did, but missed the part about getting them back.

How do I create a new .Xauthority file? I have tried 'transplanting' one from another Ubuntu 15.04 system I have, however this did not work and I suspect they may be unique for each install.
As I said earlier - X.org generates those files for the current session. You do not need to create them and copying them from another system will not help. When X starts those files will be created, when you stop X they get deleted. This is why you can rm those files safely (and why I suggested doing so).

Your problem lies elsewhere, which is why you need to look at the log files...

Also: create another user and try to login via your display manager as that other user.
 
Old 10-16-2015, 07:28 AM   #11
Entropy1024
Member
 
Registered: Dec 2012
Location: UK
Distribution: Ubuntu 16 & 17
Posts: 131

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by cynwulf View Post
As I said earlier - X.org generates those files for the current session. You do not need to create them and copying them from another system will not help. When X starts those files will be created, when you stop X they get deleted. This is why you can rm those files safely (and why I suggested doing so).

Your problem lies elsewhere, which is why you need to look at the log files...

Also: create another user and try to login via your display manager as that other user.
I decided to re-install Ubuntu from scratch. I need the system running and although it would have been rewarding to find out the fix I ran out of time.

Thanks for the help.
Tim
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Xauthority issue : Error: Can't open display: Sush093 Linux - Newbie 3 12-24-2014 02:18 PM
[SOLVED] Can't print to Windows printer, suspect Samba issue maples Linux - Newbie 14 11-03-2014 03:28 PM
rkhunter scan: 1 Rootkit & 6 Possible Suspect Files /var/log/rkhunter.log included Mollusc Linux - Security 10 09-29-2011 08:43 AM
AMD64 Install issue, Mandrake 10.1; Suse 9.2; Debian 3.03; Asrock/sis 180 suspect tach Linux - Hardware 1 02-01-2005 05:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration