Once in every two years I have a problem forwarding X over ssh. I
have X11Forwarding yes
in
/etc/ssh/sshd_config
, and ForwardX11 yes
in /etc/ssh/ssh_config
. I do ssh -X
<server>
, and $DISPLAY
is not set.
I couldn't remember how I fixed that before. Doing sudo
/etc/init.d/ssh stop
(is safe to do also remotely - it
doesn't kill the current connection - as long as you don't lose
the shell you can later start it from ) and sudo
/usr/sbin/sshd -ddd
on the server, and sshing from the
client didn't reveal anything.
I was lucky enough to find the solution at http://www.oreillynet.com/linux/blog/2006/08/problems_forwarding_x_over_ssh.html,
in the comments by Herb Swanson and Simon: apt-get install
xbase-clients
has solved the issue. The latter comment
also mentions how one could find out what the problem was:
ssh -vvv -X <server>
would show "debug1:
Remote: No xauth program; cannot forward with spoofing." (and it
turned out to be that one -v would have been enough).
After the fact I remember how I had solved that before: I did
sudo strace -o /tmp/zzz /usr/sbin/sshd -ddd
on a
working and not working systems, sshed to both, and compared the
strace outputs, which is obviously much more effort than reading
the client debug output.