I have had Putty connecting via SSH to my Ubuntu 12.10 server for several months. Yesterday I began to get the following error every time I connect:

PuTTY X11 proxy: wrong authentication protocol attempted

I can do everything in the session except launch X Windows applications. To my knowledge nothing changed on the Windows side, and I did recently install @20 updates on the Ubuntu side during normal upgrade maintenance.

I use Xming as an X server on the Windows client. And as I said it was working just fine. I have ready dozens of Google results searching on this error and most seem to involve the error happening after an SSH connection while attempting to SU or SUDO to another account, but this is happening to my regular user connection.

I have tried deleting the .Xauthority file in my home directory, also various xauth add commands to try and get the correct "magic cookie" back into the .Xauthority file. Nothing has worked.

Any thoughts?

  • 3
    You've probably seen this. I understand that the cause of your problem isn't the same as the cause there. But did you try the less secure solution there, enabling ForwardX11Trusted? (This shouldn't be done when any non-trusted users who can SSH in, see man 5 ssh_config.) If it's safe for you to enable this, then even if you don't want to keep it enabled, this would give valuable information. – Eliah Kagan Feb 15 '13 at 2:27
  • Also, you said you tried "various xauth add commands" ...but is the output of xauth commands that give information as expected? If not, that could shed some light on the situation. What's the output of xauth list (you can go ahead and remove or replace the hexadecimal key, no need to share that). The best way to provide all this information is to edit your question; please also include as many details as possible about all the xauth commands you did try and what happened. – Eliah Kagan Feb 15 '13 at 2:30
  • Can you please post a screenprint of your Putty's X11 configuration, which will be inside SSH on the left side bar? If I am not wrong, your server expects you to do XDM Authorization but you are trying to do Magic Cookie. Just try changing it to XDM-Authorization-1. – thefourtheye Apr 6 '13 at 19:18
  • Did a recent change in server:/etc/ssh/sshd.conf change "Protocol 1,2" to "Protocol 2"? There are known vulnerabilities with Protocol 1, but that might be what Putty uses. Or cah you configure Putty to use Protocol 2? – waltinator Apr 21 '13 at 18:32
  • froebe.net/blog/2008/11/14/… – j0h May 9 '13 at 17:15

Reformatted for ask from http://froebe.net/blog/2008/11/14/getting-xlib-putty-x11-proxy-wrong-authentication-protocol-attempted-i-have-the-answer/

As mentioned above, you can break your security by switching on ForwardX11Trusted yes in the /etc/ssh/sshd_config file on the server and restart sshd. The full solution is to temporarily transfer the authorization to the other account.

First, on your client get the key from your account (on windows this is for xming and might be in the xming configuration):

$ xauth list
aspc2o1/unix:10 MIT-MAGIC-COOKIE-1 bc664c66cfec3c5c3d5b0efc4ee9d3ad

Next, log into your ssh/putty account and add the xming key (this might actually be in the configuration for putty).

$ xauth add aspc2o1/unix:10 MIT-MAGIC-COOKIE-1 bc664c66cfec3c5c3d5b0efc4ee9d3ad

Now you should be able to open up apps when you forward the X display over ssh.

  • 1
    No one is reading man pages anymore, it seems. Setting this option in sshd_config will prevent the SSH server from starting successfully! Try man sshd_config|grep ForwardX11Trusted versus man ssh_config|grep ForwardX11Trusted. -1. – 0xC0000022L Aug 7 '14 at 0:08
  • thanks man... solved my problem from Putty/Windows/XMing to Raspbian Pixel... strangely the display number for the X when I elevate the previlege (sudo su) is :11 ... not :10 ... ?why – ZEE Oct 12 '17 at 4:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.