Here are some notes on setting up PuTTY to allow X11 forwarding to Xming, ultimately also using sudo.
Ensure the servers you are connecting to have “X11Forwarding yes” set in /etc/ssh/sshd_config. Restart ssh if necessary.
Starting with PuTTY, after you have already set up the Session connection stuff and know you can ssh to the target, in the configuration under Connection
-> tick Enable X11 forwarding
-> leave X display local blank
-> tick MIT-Magic-Cookie-1
-> leave X authority for local display blank
Save your putty session.
-> Multiple windows
-> Display number : 10
-> Start no client
-> Clipboard, Native opengl & Disable access control all ticked
Now make the Putty connection to the target and you should be able to run xclock to test.
To sudo to root and be able to run X apps:
Run “xauth list” and you should see a list of one or more cookies. Find the one labelled MIT-MAGIC-COOKIE-1 that has the corresponding display number. For example:
sparticus/unix:10 MIT-MAGIC-COOKIE-1 1ccb738692bac9383747ff
Now “sudo su -” to get root access (I’m assuming sudo is already setup to allow this). Then run
xauth add sparticus/unix:10 MIT-MAGIC-COOKIE-1 1ccb738692bac9383747ff export DISPLAY=localhost:10.0
You should again be able to run an X application like xclock.
If you need to ssh to other servers from your initial PuTTY session and be able to run X11 apps, use ssh -XY [servername] to ensure X11 is forwarded.
You must log in to post a comment.