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

From my (Debian) Desktop machine, I am trying to ssh into a Debian Server with

 ssh -X remote-ip

After logging into the remote host, I get:

 /usr/bin/X11/xauth:  creating new authority file /root/.Xauthority
 /usr/bin/X11/xauth: (stdin):1:  bad display name "unix:10.0" in "remove" command
 /usr/bin/X11/xauth: (stdin):2:  bad display name "unix:10.0" in "add" command

And the X Forwarding doesn't work. From my Desktop I can ssh -X into other Debian servers and it works fine. I found a lot of threads discussing similar issues on google, but they all seem to fade out without a solution, and the simple things suggested there like exporting DISPLAY or setting xhost + don't seem to make a difference.

share|improve this question

Add the host name you're connecting to your dns or hosts file. reconnect using ssh -X root@hostname rather than ip. - delete any offending keys if necessary.

share|improve this answer

Try -Y instead of -X

ssh -Y remote-ip

From the ssh man page, this "Enables trusted X11 forwarding. Trusted X11 forwardings are not subjected to the X11 SECURITY extension controls."

If this works, you can add to ~/.ssh/config:

Host remote-ip
ForwardX11Trusted yes

and you won't need to explicitly add -Y.

To figure out why this remote machine behaves differently from the others, take a look at the sshd_config file -- found in /etc/ssh/sshd_config on RedHat. I'm don't know if it's in a different location on Debian.

There's more discussion of related issues in another SuperUser question.

share|improve this answer
up vote 0 down vote accepted

I was unable to resolve this, even after making sure the config files were the same on the working and non working machines. As a workaround, I installed x11vnc and used the vnc protocol instead of X11.

share|improve this answer

You must log in to answer this question.

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