Ssh – over ssh -X : DISPLAY is not set

debiandebian-squeezessh

I try connect over ssh with

 ssh -X user@host

but I get

$ xterm
xterm Xt error: Can't open display: xterm:  DISPLAY is not set

$ echo $DISPLAY
# ... nothing

In my sshd_config I have

X11Forwarding yes
X11DisplayOffset 10

EDIT

In /var/log/auth.log I get

 sshd[7396]: error: Failed to allocate internet-domain X11 display socket.

Best Answer

If ipv6 is causing an issue, add this to /etc/ssh/sshd_config and restart ssh.

AddressFamily inet