How to tunnel X over ssh

So I am sure this exists somewhere else on the web, but here is my two cents for what you need to do to get automatic X tunneling.

For instructive purposes, we will use a small scenario to explain what needs to be done. There are two machines names my_local_machine and far_away_machine. my_local_machine is the machine whose local X server that you want to display to and far_away_machine is the machine that you want to run a program on and have it displayed to my_local_machine.

Steps that you need to do:

  1. Make sure that the machine that you are connecting to, far_away_machine, has the following line in its sshd_config file. This file usually lives in either '/etc/' or '/etc/ssh'.
    X11Forwarding yes (THIS IS THE LINE THAT YOU NEED)
    If this is not there contact the owner/sysadmin for the far_away_machine and have this line added.
  2. Log into far_away_machine and type 'xterm &' or something like that and see the ssh tunneled window appear on my_local_machine's screen.

Frequently Asked Questions

If you like this page send me some e-mail at wentzlaf AT cag.lcs.mit.edu
You can also find more contact info for me on my homepage