How to Tunnel X Windows Securely over SSH

by on November 20, 2007 · 4 comments· last updated at November 20, 2007

Q. How do I tunnel X Windows Securely over SSH? I'd like to run X program on my remote Linux server and get back display to Laptop computer connected by high speed internet?

A. A tunneling protocol is a network protocol which encapsulates a payload protocol, acting as a payload protocol. Reasons to tunnel include carrying a payload over an incompatible delivery network, or to provide a secure path through an untrusted network.

SSH is frequently used to tunnel insecure traffic over the Internet in a secure way. Simply type the following command:

$ ssh -X user@server.corp.com
$ ssh -X user@202.54.1.2

You can requests compression of all data to improve up user experience (good for a low speed link such as wan link) using -c option:
$ ssh -c -X user@202.54.1.2

Once logged in type any X windows program name such as:
$ xeys &
$ oowriter &

To start kde type:
$ startkde &

To start default desktop type:
$ startx



You should follow me on twitter here or grab rss feed to keep track of new changes.

Featured Articles:

{ 4 comments… read them below or add one }

1 Bruno November 21, 2007 at 2:03 pm

I can help to say that at least for me, FreeNX from NoMachine has been easy and reliable. I use it a lot from a windows PC and a MacOSX. Configuring a HTTP Proxy is very simple too

Reply

2 wekker-tiktak February 2, 2008 at 10:27 am

To run qemu to start a virtual machine, on a remote host you need to use the command ssh -Y instead of -X, ssh -X results in an error message without starting an remote virtual machine.

-Y Enables trusted X11 forwarding. Trusted X11 forwardings are not subjected to the X11 SECURITY extension controls.

When the sshd server is configured with “X11Forwarding no”, try the following to run remote x xlients:
1. xhost +localhost
2. ssh -R 6000:192.168.2.1:6000 test@ahost
3. On remote ahost export DISPLAY=127.0.0.1:0.0

Reply

3 Dustin Boswell October 2, 2008 at 7:12 am

Here’s an article about
how this “X tunneling” is really working

(for those of you who care how stuff works under the hood).

I agree, NX is totally awesome – amazingly fast.

On a related note, if you’re trying to help out a relative with their computer, I just tried out Co-Pilot which surprisingly “just worked”. It’s not really an alternative to NX, but way better for this remote-assist case.

Reply

4 frater mus December 30, 2011 at 3:35 pm

ssh -C = compression
ssh -c = cipher

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <kbd> <blockquote> <pre> <a href="" title="">

Tagged as: , , , , , ,

Previous Faq:

Next Faq: