Super User is a question and answer site for computer enthusiasts and power users. 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'm trying to get Xforwarding working in Ubuntu... On the server I have uncommented the following lines of /etc/ssh/sshd_config:

X11Forwarding yes
AllowTcpForwarding yes

Now I try to ssh in, but I get the following error messages (and Xforwarding isn't working).

$ssh -Y
/usr/bin/xauth:  /home/dan/.Xauthority not writable, changes will be ignored

$ssh -X
/usr/bin/xauth:  error in locking authority file /home/dan/.Xauthority

Any suggestions?


share|improve this question
up vote 3 down vote accepted

Looking at the error messages, I'd have to guess that ~/.Xauthority is not owned by you. It should be, with 600 permissions.

I think your best solution is to delete it. The next time that you connect with ssh -X, you should see the message "creating new authority file", and everything should be fine.

Incidentally, my Ubuntu 9.10 installation has port forwarding and X11 forwarding enabled out of the box. I can't remember what I did to my 8.04LTS installation, but I'm pretty sure that my only change was to add another port for inbound SSH.

share|improve this answer
chown fixed my issues... I have no idea how that happened, but turns out root owned the file. Thanks. – Jarvin Apr 15 '10 at 0:36
I have seen it where the .Xauthority file was in the wrong state, and everything was fixed by deleting it, logging off and reconnecting via SSH. Something in the sshd seems to set up the $DISPLAY and .Xauthority if it can. I believe that running startx was the bad thing that got things mucked up. Must remember to use xclock to test the X connection. – Michael Dillon Jun 27 '12 at 6:15

If you have the same problem, simply run chown as root to change the ownership back to the user. At the terminal as root, go to /home/user

# cd /home/user

list all files with ownership

# ls -a -lh

change file/files ownership to your user

# chown user:user .Xau*


share|improve this answer

You must log in to answer this question.

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