I've read numerous similar questions but many are outdated and nothing seems to work.
I have an homePC <remotehome> and a laptop <locallaptop>, both running Ubuntu 22.04.
I'm away from home, I can ssh into <remotehome> both with psw or private key.
sudo ssh -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa -X -p 2022 remoteuser@<remotehome>
(the port is 2022 because of port forwarding on my home router, idk if relevant)
Once on remote host, xdg-open or firefox commands give me:
X11 connection rejected because of wrong authentication.
Error: cannot open display: localhost:10.0
Running xlogo on remote terminal actually opens a window on my local desktop.
Useful Info:
df -H
on remote terminal, plenty of space.
ls -l ~/.Xauthority
output:
-rw------- 1 remoteuser remoteuser 69 mar 22 15:23 /home/remoteuser/.Xauthority
X11 Forwarding is enabled on <remotehome>
X11Forwarding yes
in /etc/ssh/sshd_config.
On client X11 Forwarding is enabled.
Host *
ForwardX11 yes
in /etc/ssh/ssh_config
xhost command gives the same output from both the remote and local terminal:
access control enabled, only authorized clients can connect
SI:localuser:<my-username-in-local-laptop>
The $XAUTHORITY var on my local desktop is:
/run/user/1000/.mutter-Xwaylandauth.PLS211
I've tried the solution proposed here and here and here. Nothing seems to work. Any help to debug this issue is really appreciated.

export DISPLAY='IP:0.0', where IP is the local workstation’s IP where you want the GUI application to be displayed. `. – harrymc Mar 22 '23 at 15:25localhostmeanssshdis supplying a X11 proxy on the remote end, which tunnels the X11 protocol inside the SSH connection to the local workstation. If the DISPLAY had the IP address of the local workstation, that would mean the GUI apps on the remote host would attempt to use plain unencrypted X11 protocol to connect directly to the local workstation, which would be a massive security risk unless you are in a trusted network. – telcoM Mar 22 '23 at 15:38