Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
When you say switch to a vt is this not the tty via CTRL+ALT+F1?
I have removed the .Xauthority already using the rm command, I can do the same with the .serverauth.* files, where are they stored?
After I do this will I not be left without the .Xauthority file again & possibly also missing these .serverauth.* files?
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
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
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.
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.
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
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.