Xforwarding in Ubuntu
Solution 1
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.
Solution 2
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
Related videos on Youtube
Jarvin
Updated on September 17, 2022Comments
-
Jarvin over 1 year
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
-
Jarvin about 14 yearschown fixed my issues... I have no idea how that happened, but turns out root owned the file. Thanks.
-
Michael Dillon almost 12 yearsI 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.