Solved ssh X11Forward redirects stream to the wrong port

mfoacs

New Member

Thanks: 1
Messages: 12

#1
I have been banging my head around this one for days:
I am connecting to a remote FreeBSD 11.2-RELEASE-p4 (GENERIC) from a Linux box.
On the remote machine, sshd has been configured correctly I assume since:
Code:
debug2: X11 forwarding request accepted on channel 0
.
Once connected, I check the DISPLAY variable:
Code:
localhost:10.0
I have also a look into the open ports:
Code:
username      sshd       55532 8  tcp4   127.0.0.1:6010        *:*
I then launch xclock and the result is:
Code:
debug1: client_input_channel_open: ctype x11 rchan 4 win 65536 max 16384
debug1: client_request_x11: request from ::1 22511
debug2: connect localhost port 6000: Connection refused
debug2: connect localhost port 6000: Connection refused
connect localhost port 6000: Connection refused
debug1: failure x11
Error: Can't open display: localhost:10.0
Why is sshd redirecting the stream to the port 6000?

Both the client and the remote machine have a running xorg installation.

On the remote machine ssh and xorg have been compiled from sources, then uninstalled and reinstalled from the FreeBSD repository. It makes no difference.

PF is enabled, and I have tried disabling it too. No change.

Google hasn't provided much help either, I have checked and re-checked all configuration files and everything is ok as far as I can tell.
To make matters worse, it had been working until a few days ago, so I really don't understand.

Any ideas, hints, debugging instructions would be much appreciated.
 
OP
OP
M

mfoacs

New Member

Thanks: 1
Messages: 12

#2
It turns out that I had export DISPLAY=0 on the local computer messing up things. I removed the setting and everything is now working as expected.
 
Top