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.0so, 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 addHowever, it didn't work as the xauth list command returned nothing.
the second solution was to go to:
./etc/ssh/sshd_configopen the file: sshd_config and edit the ForwardX11Trusted line to read yes, and If no such line exists, add it in.
ForwardX11Trusted yesthen 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 ?
36 Answers
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!
5I had a similar problem on a server at work because the home folder was out of disk space. After login, it couldn't write the Xauthority file and... couldn't forward.
Freeing up space resolved the issue.
I would imagine you would have a similar problem if home folder or .Xauthority permissions were set improperly so you did not have write access.
Solved.
I got it solved using a mixture of the two mentioned above.
1. I added the following line to '/etc/ssh/sshd_config'
ForwardX11Trusted yes2. I installed xauth using
sudo apt-get install xauthxauth list was empty for me before restart. It was, however, populated after the restart. I did xauth list after I tested it with putty.
Then I restarted ssh and it worked. Yay!
Note: What I actually did was restart my Raspberry Pi
2In my case, I noticed I could open the Display with root, but I was doing a su - grid, and this user grid was the one with the problem,
the solution was to close this session, and open a new session directly with grid, and it worked, something about doing the su - grid was failing...
I had a similar problem on a server. The reason was that user got the wrong number of display (DISPLAY=localhost:10.0). When user connects to the server via SSH (as user called test1) he gets DISPLAY=localhost:11.0. When he connects as another user, and then becomes user (test1), he gets wrong number of display (DISPLAY=localhost:10.0). When I set the rifght number of DISPLAY (DISPLAY=localhost:11.0) it works.
check whether $DISPLAY variable is set, command: echo $DISPLAY if the display variable is not set, run this command: export DISPLAY=:0.0
3