openssh, X11 connection rejected because of wrong authentication.

ponder

Honorary Master
Joined
Jan 22, 2005
Messages
99,327
Reaction score
31,745
Location
Niflheimr
I've installed opnssh as per the arch wiki and all is well except for one thing, if I try and open apps as root or with sudo I get the above error.

Code:
[xxxx@asterix ~]$ sudo leafpad
[sudo] password for xxxx: 
X11 connection rejected because of wrong authentication.
leafpad: Cannot open display:

Opening it as a normal user works fine. Using Manjaro/Arch
 
I've not tried to do this (fiddling with remote X) but do you have xauth installed on the server?
 
Have you tried loging in as root, then try opening the app? Arch should allow root login.
 
I've not tried to do this (fiddling with remote X) but do you have xauth installed on the server?

Yes I have it installed.


Have you tried loging in as root, then try opening the app? Arch should allow root login.

No. I have root login disabled via ssh. I had this working before but did a fresh install on my laptop & desktop recently.
 
i believe i read somewhere that ssh now does not carry x authority to a secondary user. so it only allows x forwarding for the user you logged in as.

i suspect you should be able to verify this through a google search.
 
i believe i read somewhere that ssh now does not carry x authority to a secondary user. so it only allows x forwarding for the user you logged in as.

i suspect you should be able to verify this through a google search.

Yes that is correct but there is a very simple 'workaround' for it, I did it before but for the hell of me I can't remember what I did.
 
Try to execute "xhost +leafpad", before changing to that user "leafpad". If this does not work, then try this :)
 
Top
Sign up to the MyBroadband newsletter
X