Sep 04 2008
Access X11 Applications via SSH and Putty
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