Frogpond Badge

Getting “Xlib: PuTTY X11 proxy: wrong authentication protocol attempted”? I have the answer :)

Here’s the scenario:

You ssh to a remote server with your login and either sudo or su to another user to run some application that uses a X Windows front end.  There is a firewall between your desktop and the remote server that allows only ssh connections (port 22).  When you run into the error “Xlib: PuTTY X11 proxy: wrong authentication protocol attempted”.  What to do?

ssh jason@remote-server -X
jason $ echo $DISPLAY
localhost:10.0
jason $ su – oracle
oracle’s Password:
oracle $ xterm
Xlib: connection to "localhost:10.0" refused by server
Xlib: PuTTY X11 proxy: wrong authentication protocol attempted
xterm Xt error: Can’
t open display: localhost:10.0

On recent OpenSSH Server releases, you can simply enable “ForwardX11Trusted yes” in the /etc/ssh/sshd_config file and restart the OpenSSH server.  If you’re not using a recent OpenSSH Server release or if you can’t for security or political reasons, what could you do? Give up? It’s simpler than you think.
You need to temporarily transfer the authorization to the other account. First, get the key from your account:

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

Next, sudo/su to the other account and add the authorization key.

jason $ su – oracle
oracle $ xauth add aspc2o1/unix:10 MIT-MAGIC-COOKIE-1 bc334c66cfec3c5c3d5b0efc4ee9d3ad

Now, you should be able to start any X Windows application, assuming that your DISPLAY variable is set to go through the ssh tunnel:

oracle $ xterm

20 comments to Getting “Xlib: PuTTY X11 proxy: wrong authentication protocol attempted”? I have the answer :)

  • Sudarsan

    Very useful and rare to get this kind of exact and precise work around. Million thanks.

  • Naveen

    wonderful solution….thanks a ton….

  • Steve

    Awesome. Glad I was able to find this. Works perfectly and exactly what I was looking for!

  • Thank you for the tip Jason! I’ve been struggling with this issue for months and been doing silent Oracle installations as a result at one of my clients. I just tried your suggestion and it worked like a charm.

    Many, many thanks!

  • rahul

    hey i m not able to open the display when i want to open text editor or gvim it gives the error
    Xlib: connection to “yamsrv1.ece.gatech.edu:11.0″ refused by server
    Xlib: PuTTY X11 proxy: wrong authentication protocol attempted

    (gedit:16728): Gtk-WARNING **: cannot open display:
    any help is appreciated

  • Rahul,

    If you’re using Windows, you may have to tell your X Windows software to allow the incoming connection from the putty session. Which X Windows software are you using?

    I’m guessing you’re using Windows because putty isn’t too terribly common on Unix/Linux/MacOSX desktops.

    Jason

  • rahul

    hey i am using xming + putty
    on windows desktop
    xming version 6.9.0.31

  • rahul

    i am trying to access linux based server remotely

    regards
    rahul

  • Hi Rahul,

    I haven’t used xming very often but the last time I followed http://www.straightrunning.com/XmingNotes/trouble.php Does this help?

    jason

  • rahul

    I went thru that before only but the thing is my xserver is somehow not able to connect…
    I still dont know
    i m sure abt this cos none of my friends had this problem and we are accessing the same remoyte server so no change is required at the remote server side and neways we dont have root rights at remote server
    can thre be any fire wall problem i m gonna try tht now …but i m not sure

  • rahul

    but i am activatin xming before starting putty…which is how we are suppose to do
    but still i donno wats the problem
    :(

  • which X11 authentication protocol do you have set in PuTTY?

  • rahul

    hey I got it running
    I used X11 forwarding only
    The problem I gess was with my user account the xterm parameters were not set properly
    and I dont have the root accesss
    I donno whther you can do nething abt it without the root access…ne suggestions is welcome :)
    I have sent the request to the college support staff
    I am currently working on my friends account :)

  • congrats Rahul! I’m glad you got the x11 forwarding to work using putty :)

  • Debra

    Thank you for posting this precise answer. It was just what I was looking for.

  • siegfried

    i came in to start my oracle install on a new box ( via sudo not a direct login as in the past ) at 8am monday morning and get this error – not a good start. so i cut and paste the whole message into google. your page comes up first on the list. the solution works as advertised :) too easy.

    thanx heaps.

  • Martin

    I ran into the same problem, thanks for pointing me in the direction of xauth. Further googling got me the solution for my Ubuntu server:

    Install pam_xauth to transfer xauth cookies between users on su. Now the problem is solved!

  • Karyn Wheeler

    Thanks a bunch Jason.
    I normally never post messages..but GOD bless for passing on the knowledge and information.
    Thanks again!

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>