SSH login with x11-forwarding and sudo doesn’t connect to the x11 server

The remote side’s root doesn’t have the right X11 magic cookie. Hand it over to the root.

xauth list $DISPLAY | xargs sudo -H xauth add

Another way:

“`shell
sudo xauth merge $HOME/.Xauthority
“`

Leave a Reply

Your email address will not be published. Required fields are marked *