using x11 forwarding with ssh from a jail

Erwin Lansing erwin at
Mon Apr 21 02:14:19 PDT 2003

On Sun, Apr 20, 2003 at 07:31:33PM -0400, Brian Dean wrote:
> Hi,

> Is anyone having problems connecting to their X server from inside a
> jail using ssh's X11 forwarding?
> >From my non-jail environment, I ssh into my jail environment with X11
> forwarding enabled.  When I try to invoke an X application, I get:
>   % xclock
>   X11 connection rejected because of wrong authentication.
>   X connection to localhost:11.0 broken (explicit kill or server shutdown).
> It works fine if I uset 'xhost +' in my non-jail environment and the
> point my display appropriately from inside the jail (bypassing ssh x11
> forwarding).  Any ideas why X11 forwarding doesn't seem to do the
> right thing?
This has probably something to do with the mapping of localhost to the
external ip address of the jail. Try setting:

X11UseLocalhost no

in /etc/ssh/sshd_config in your jail should fix this.


                    _._     _,-'""`-._
Erwin Lansing      (,-.`._,'(       |\`-/|
erwin at       `-.-' \ )-`( , o o)
                    -bf-      `-    \`_`"'-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url :

More information about the freebsd-hackers mailing list