X11 forwarding through SSH: Can't open display

sk89q the.sk89q at gmail.com
Sun Jan 25 21:35:34 PST 2009


Hello,

I am using FreeBSD 6.2 and I have been trying to get X11 forwarding
through SSH to work. I've gotten to the point where the environment
variable "DISPLAY" is set, but I get a "Can't open display" error when
I attempt to run an X application. The remote server in question does
not have an X server install.

In /etc/ssh/ssh_config, I have the following lines:
X11Forwarding yes
AllowTcpForwarding yes
UseLogin no

When I first tried logging in with `ssh -Xvvv user at host`, I got an
error message stating that "xauth" could not be found. DISPLAY was not
set and X11 was not forwarded. `sockstat -4 | grep sshd` didn't return
any relevant entries. Looking at the strings of sshd, I noticed that
it had a hard-coded path pointing to "/usr/X11/bin/xauth", so I made a
hard link from "/usr/local/bin/xauth" to "/usr/X11/bin/xauth". Now,
sshd can find xauth, and DISPLAY is properly set to "localhost:10.0".

sockstat shows:
USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS
root     sshd       62372 7  tcp4   127.0.0.1:6010        *:*"

However, running `xeyes` reports the error "Error: Can't open display:
localhost:10.0".

Right now, `ssh -Xvvv user at host` shows:
debug2: x11_get_proto: /usr/bin/xauth -f /tmp/ssh-dd77LaQ9BG/xauthfile
generate unix:0.0 MIT-MAGIC-COOKIE-1 untrusted timeout 1200
2>/dev/null
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Warning: No xauth data; using fake authentication data for X11 forwarding.
debug1: Requesting X11 forwarding with authentication spoofing.
debug2: channel 0: request x11-req confirm 0

On the local end, I have tried connecting with PuTTY, ssh through
Cygwin, and ssh on a Ubuntu system. I have also tried ssh -Y as well.

Regards,
sk89q


More information about the freebsd-questions mailing list