SSH X11 Forwarding



This method is used to run X11 (GUI based) programs in remote machine, and output the display to the local machine. The purpose is almost similar to VNC and such, though they are technologically very different.

To use this feature, simply add the -X option when running ssh. The following example would also try to start the program xclock, and if all goes well the remote program should appear on your local machine;

user@local ~ $ ssh -X user@remote-machine
user@remote ~ $ xclock

If it fails, set the these options in the remote machine’s /etc/ssh/sshd_config as the following and restart the service;

X11Forwarding yes

If it still doesn’t work, try to check your local machine’s /etc/ssh/ssh_config and set these option as the following;

ForwardX11 yes

Posted on 14.01.2009 and categorized under linux

Comment Form


  • ayaz: Thanks for the tip.
  • TrueColorTech: Awesome Tip, I have been wanting that option for a while now!
  • iGadget: If this would work, it'd be really nice. However, when I use the command described in your post, I get the following error (twice): Could not conne
  • Alan: fedora 10 is so cool and i have fedora 10 too!
  • Kyle: Forgot to swing back by here after finding version 5.1.3 available, posted about it here: http://yokohead.com/2009/01/google-gears-in-firefox-x64-for

Categories