Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 example.com
/usr/bin/xauth:  /home/dan/.Xauthority not writable, changes will be ignored

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

Any suggestions?

Thanks

share|improve this question

2 Answers 2

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*

from http://namhuy.net/1077/fixing-error-in-locking-authority-file-xauthority.html

share|improve this answer

Your Answer

 
discard

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.