First off: I have read the answers to similar questions on SO, but none of them worked.
IMPORTANT NOTE: The answer below is still valid, but maybe jump to the end for an alternative.
The situation:
What works:
.Xauthority
file to the other user and X11 forwarding works as well.Some setup info:
DISPLAY
variable is set in container (to host-ip-addr:10.0 because of TCP port 6010 where sshd is listening).tcpdump
checked).What does not work:
X11 connection rejected because of wrong authentication.
xterm: Xt error: Can't open display: host-ip-addr:10.0
Things i tried:
ssh -Y
option on machine B"X11ForwardTrusted yes"
in ssh_config on machine Bxhost +
(so allow any clients to connect) on machine BHost *
in ssh_config on machine BX11UseLocalhost no
in sshd_config on machine A (to allow non-localhost clients)xauth add
from the login user on machine A.Xauthority
file from a working user into the container.Xauthority
file has correct permissions and ownerHow can i just disable all the X security stuff and get this working?
Or even better: How can i get it working with security?
Is there at least a way to enable extensive debugging to see where exactly the problem is?
Alternative: The first answer below shows how to effectively resolve this issue. However: I would recommend you to look into a different approach all together, namely VNC. I personally switched to a tigerVNC setup that replaces the X11 forwarding and have not looked back. The performance is just leagues above what X11 forwarding delivered for me. There might be some instances where you cannot use VNC for whatever reason, but i would try it first.
The general setup is now as follows:
-VNC server runs on machine A on the host (not inside a docker container).
-Now you just have to figure out how to get a GUI for inside a docker container (which is a much more trivial undertaking).
-If the docker container was started NOT from the VNC environment, the DISPLAY
variable maybe needs ajdusting.