Can jail use x11forwarding?

I use ssh -X -p 44 root@1.1.1.4 to connect to my jail, but when I open an application, it says X11 connection rejected because of wrong authentication
Is mount the .X11-unix the only way to open graphic applications in jail
 
Make sure to enable X11Forwarding in your sshd_config.

Additionally, if its a jail/chroot on the same host, you can use direct X11 access via sharing the the AF_UNIX socket.

Make sure Jail and /tmp is on the same FS and use ln (not -s) to create a link to /tmp/.X11-unix.

Then make sure to copy across the Xauthority file (containing the MIT-MAGIC-COOKIE (regardless of what the Wayland newbies repeat from reddit, X11 has authentication measures)

Don't use root user for this though. GUI software is too flaky to trust running under root privilege and many bits of software correctly have checks preventing it.
 
Back
Top