Sep 04 2008

Access X11 Applications via SSH and Putty

Published by at 10:46 pm under Linux




You would like to access X11 applications on your server, but it is only reachable with SSH? Nevermind with Putty! Putty allows you to create an SSH tunnel in which the X11 flow is encapsulated: X11 forwarding.
 
xorg-x11-xauth has to be installed on the server side to be authenticated on X.
Launch a graphical manager on your workstation. We’ll use Cygwin here.
Run Cygwin, launch startX and type in:

xhost +

to authorize all clients to connect.
Finally, Run Putty. In Connection -> SSH -> Tunnels, check "Enable X11 forwarding"
Open a session and log in.
A .Xauthority is created in the current directory: it’s the cookie that authenticates the session.
Launch an X application and it will show up on your workstation. xclock for instance.
 
To run an application from a different user – after a su for instance -, give access to the .Xauthority file, and set his XAUTHORITY variable:

export XAUTHORITY=/home/user/.Xauthority

One response so far

One Response to “Access X11 Applications via SSH and Putty”

  1. Jennyon 23 Dec 2008 at 10:42 pm

    Great article. I found some more information here

Comments RSS

Leave a Reply