Linux – PuTTY X11 proxy: wrong authorisation protocol attempted

linuxputtysshUbuntu

I am trying to connect to an Ubuntu server to work on Qt-creator. Before everything goes wrong, I followed this tutorial. I downloaded putty and Xming and everything was working just fine.

then, suddenly, while working on Qt-creator I couldn't save any changes. So, I closed Qt-creator and restart the putty session. it asked me about username and password (as usual) then after log-in into the server and when I tried to run Qt-creator (as usual) the following message appears:

PuTTY X11 proxy: wrong authorisation protocol attempted
Can't open display: localhost:10.0

so, I tried to resolve the problem using two approaches found in the internet:

the first one is by getting the dpyname protoname hexkey using:

xauth list 

which should return the key which is then could be added using:

xauth add

However, it didn't work as the xauth list command returned nothing.

the second solution was to go to:

./etc/ssh/sshd_config

open the file: sshd_config and edit the ForwardX11Trusted line to read yes, and If no such line exists, add it in.

ForwardX11Trusted yes

then restart the ssh server and it should work.

However, it didn't work either. I could not open the file sshd_config using xdg-open or gedit and the same message appears again.

so why is this happening and what is the solution for it ?

Best Answer

While logged in as su, after a few "PuTTY X11 proxy: wrong authorisation protocol attempted" -type errors, I realized it was an authentication problem. Then I remembered to copy the .Xauthority file from my own profile /home directory to /root. Problem solved!