Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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 don't have a .Xauthority file in my home folder. I want to create it, please tell me the steps to do so in ubuntu 10.10.

Thank You!

share|improve this question
Maybe it would help, if you tell us why you want/need to create this file. – htorque Jan 17 '11 at 12:39
up vote 6 down vote accepted

In Ubuntu 10.10 there's no longer a ~/.Xauthority file. Instead you'll find the equivalent in


which will be re-created with new random characters on every session start. You can get its name via the $XAUTHORITY environment variable.

If you need a ~/.Xauthority file to be present, I guess you can simply create a symbolic link to $AUTHORITY on every session start:

  1. Open System > Preferences > Startup Applications

  2. Click on Add :

    • Name: Xauthority
    • Command: /bin/bash -c 'ln -s -f "$XAUTHORITY" ~/.Xauthority'
    • Comment: Creates a symbolic link from ~/.Xauthority to $XAUTHORITY

    and add the entry by clicking on Add.

  3. Now every time you log in, it should create the link to the current authority file.

share|improve this answer
On my 10.10, there is no ~/.Xauthority by default. – loevborg Jan 17 '11 at 10:38
@loevborg: Thanks, I totally missed that. Updated my answer. – htorque Jan 17 '11 at 12:52
Thanks a lot guys problem is solved, actually problem was setting the wrong ENV variable in the script for $DISPLAY – Parimal N Jan 17 '11 at 13:15
On my 12.04, there's still an ~./Xauthority file... – Cerin Feb 3 '14 at 5:21

(there indeed appears to be .Xauthority files in Ubuntu 14.10, so I don't know, per the accepted answer, if they went away and came back?)

Probably solved a long time ago but for completeness, when you ssh to a remote system, use:

ssh -X user@remote

You will get a complaint that the .Xauthority file did not exist and also find it was just created. This is dependent some settings in /etc/ssh/sshd_config:

X11Forwarding yes 
X11DisplayOffset 10 
X11UseLocalhost yes

Refer to where I was able to confirm my own experience with this errant error.

While you are checking / updating /etc/ssh/sshd_config make sure root login is disallowed, just a good practice:

PermitRootLogin no
share|improve this answer

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.