Solved X11 forwarding in ssh not working on one machine

cracauer@

Developer
I have several almost identical 14-current machines. I can use `ssh -Y` just fine with all of them except one.

ssh -v logs, let's start with a working one:
Code:
debug1: Remote: /home/cracauer/.ssh/authorized_keys:2: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Remote: /home/cracauer/.ssh/authorized_keys:2: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: No xauth program.
Warning: No xauth data; using fake authentication data for X11 forwarding.
debug1: Requesting X11 forwarding with authentication spoofing.
debug1: Requesting authentication agent forwarding.
debug1: Sending environment.
debug1: channel 0: setting env WINDOWID = "6291469"
Last login: Thu Apr  6 20:38:37 2023 from snarf
FreeBSD 14.0-CURRENT #0 main-n261933-8ac540d3b8bf-dirty: Fri Mar 31 22:31:00 EDT 2023     cracauer@gonzo:/gonzo-space/usr/obj/gonzo-space/usr/src/amd64.amd64/sys/GONZO

Note how it says "debug1: No xauth program.
Warning: No xauth data; using fake authentication data for X11 forwarding." although I am sure the xauth program is there on host machines. And this login works for the X11 forwarding just fine.

Here is the none working one:
Code:
debug1: client_input_hostkeys: hostkeys file /Users/cracauer/.ssh/known_hosts2 does not exist
debug1: client_input_hostkeys: host key found matching a different name/address, skipping UserKnownHostsFile update
debug1: Remote: /home/cracauer/.ssh/authorized_keys:8: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Remote: /home/cracauer/.ssh/authorized_keys:8: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: No xauth program.
Warning: No xauth data; using fake authentication data for X11 forwarding.
debug1: Requesting X11 forwarding with authentication spoofing.
debug1: Requesting authentication agent forwarding.
debug1: Sending environment.
debug1: channel 0: setting env WINDOWID = "6291469"
X11 forwarding request failed on channel 0
Last login: Thu Apr  6 20:34:46 2023 from snarf
FreeBSD 14.0-CURRENT #0 main-n261995-84b42df8345b-dirty: Wed Apr  5 01:27:00 EDT 2023     cracauer@wings.cons.org:/usr/obj/usr/src/amd64.amd64/sys/WINGS

Now there is a new line "X11 forwarding request failed on channel 0", but no explanation. The X11 forwarding does not work.

xauth is definitely there, I also put the location in the config file. I replaced sshd_config with a fresh version from the FreeBSD git tree on the server. The ~/.Xauthority file is writeable, I also tried removing it, and I used it by hand, everything works. Just not the forward.

I ran `sshd -d` on the server, but it didn't say anything about X11. I can post the output if you want.

Any ideas?
 
Just guessing, on the non-working remote machine is X11UseLocalhost set to "no" in /etc/ssh/sshd_config?
 
You say that the hosts are "almost" identical. Does this include the contents of /etc/ssh/sshd_config on the sshd servers? Is there any chance that "X11Forwarding" is set to "no" somewhere?
 
Just guessing, on the non-working remote machine is X11UseLocalhost set to "no" in /etc/ssh/sshd_config?

No, they are identical. In any case this can't be the reason. If you screw up UseLocalHost you do get X11 forwarding and the $DISPLAY variable is set. I don't get a $DISPLAY variable.
 
You say that the hosts are "almost" identical. Does this include the contents of /etc/ssh/sshd_config on the sshd servers? Is there any chance that "X11Forwarding" is set to "no" somewhere?

Oh. I thought I covered sshd_config differences by installing a fresh copy from FreeBSD git. But it looks the default is now for X11Forwarding to be off in a FreeBSD server?

In any case, now it works after I explicitly turned it on in sshd_config.
 
Oh. I thought I covered sshd_config differences by installing a fresh copy from FreeBSD git. But it looks the default is now for X11Forwarding to be off in a FreeBSD server?

In any case, now it works after I explicitly turned it on in sshd_config.
Sometimes its really strange how things work, for instance i dont even have X11Forwarding uncommented in sshd_config and yet X11 forwarding works.
 
Back
Top