One thing that troubled me moving to Ubuntu 9.10 Karmic Koala: my remote X applications stopped working with the error
X11 connection rejected because of wrong authentication
The reason seems to be that Gnome moved the location of X authorization to [wherever-the-hell-i-dont-remember], whereas ssh and everything else still use the same location (
~/.Xauthority). Note: I clearly forgot whatever it was I discovered about xauth, so please enlighten me in the comments, and I will update this exceedingly lame paragraph.
This is going to be tagged as an Emacs post because my principal reason to use remote X is Emacs’ awesome
The bash script I use is saved in ~/bin/xauthmagic:
#!/bin/bash xauth -f ~/.Xauthority list | grep -v ':0' | while read foo; do xauth add $foo; done
This means: look through all the xauth cookies in
~/.Xauthority, remove the ‘:0’ (local) display cookie, take the remaining cookies and run the
xauth command on them.
The steps I take to use this:
- On my remote host (emunah), start an ssh section forwarding X:
greg@emunah$ ssh greg@maui -Y
On my local host (maui), run the
From my local host emacs, run
M-x make-frame-on-display RET localhost:10.0 RET