Solved X11 connection rejected because of wrong authentication

Hello,

I have FreeBSD server which has a jail. I have installed xorg package and setup X forwarding

/etc/ssh/sshd_config
Code:
X11Forwarding yes
X11DisplayOffset 10

However, i I'm getting an error and X is not being forwarded.

Code:
#ssh -X -Y myjail
$echo $DISPLAY
localhost:10.0
$ xterm
X11 connection rejected because of wrong authentication.
xterm: Xt error: Can't open display: localhost:10.0
$ ls  .Xauthority
.Xauthority

My local-machine is running Gentoo Linux and i I am able to get X11 over ssh to other Linux systems.

Any idea how to get this working?
------------UPDATE---------------------

The jail is not a vimage jail, so i I set
Code:
X11UseLocalhost=No
in /etc/ssh/sshd_config. Now i I don't get the authentication error but i I still get
Code:
$ xterm
xterm: Xt error: Can't open display: myjail:10.0
-----------------------------------------

The myjail IP on the router was different to the jail. Once i I made sure that the hostname resolved to the jail IP, it started working.
 
Back
Top