20

The files are .serverauth.##### where ##### is a 5-digit number.
I have a handful of these files in my home directory with a broad range of creation dates spanning a couple of years.

What are these files from? Is it safe to delete them?

2 Answers 2

20

You can remove all of them except the newest one. They are created by the startx script. If X does not shut down gracefully, that files is not removed and stays forever (see that bug).

You can change the line in the /usr/bin/startx file, to a more handy way:

Search for xserverauthfile= in the script and replace the line with:

xserverauthfile=$XAUTHORITY
1
  • 1
    Could you explain what else this fix changes? If I understand correctly, after the change, there will be single auth file ~/.Xauthority. Why default startx script prefers to create uniquely named auth files to begin with?
    – WGH
    Commented Jul 26, 2016 at 12:21
10

Each time you start an X windows session, that file gets created and it is deleted when X session exits normally. If startx exits ungracefully - for instance, if the shutdown sequence sends it a kill signal (the script doesn't catch signals) - the file will never be removed. It is safe to remove these files.
There are probable solutions but I've never tested for side effects. Change following line in your startx command (/usr/bin/startx):

xserverauthfile=$HOME/.serverauth.$$

to

xserverauthfile=$XAUTHORITY

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .