Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My basic problem is that I would like to launch graphical application (eg firefox) on a remote computer (at work) from my computer at home. The computer at work (WPC) is behind a firewall. So I'm using SSH to remotely connect to it, in text mode.

The actual configuration I use is the following :

I have the Linux PC at work WPC I have a network drive at home NWD I have my Linux PC at home HPC

On WPC, I launch " ssh -R 23000:localhost:22 user@NWD "

When I am at home, I first connect from HPC to NWD via ssh : "ssh user@NWD", and then, from NWD to WPC via "ssh -p 23000 localhost"

That is working perfectly, but there is no X server on the network drive (NWD). So I cannot cascade two ssh -X connection.

Thus, I was thinking that I may connect directly from HPC to the 23000 port of NWD ? like that (from HPC) "ssh -X -p 23000 user@NWD", but then i got a connection refused.

The first question is do you think this could work (without an X server on NWD) ?

and if yes, How do I configure the sshd on NWD to allow access on port 23000 to other computers than just itself ?

Hope it is not too confuse

Thanks for your help


share|improve this question
up vote 0 down vote accepted

As the explanation of -R in ssh(1) suggests, on NWD set GatewayPorts yes in /etc/ssh/sshd_config. Then connect with:

ssh -R user@NWD

where is NWD's local ip address. That should allow you to do

ssh -X -p 23000

from any of the computers on that subnet.

share|improve this answer
I forgot to thank you, it works perfectly now ! – jtextori May 2 '12 at 17:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.