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.