X/ssh by port forwarding?

From: Kevin Yeung (kevincpyeung1974-usenet_at_yahoo.com.sg)
Date: 04/21/04


Date: 21 Apr 2004 00:25:50 -0700

Hi all

I understand how the -X flag of ssh allows built-in X tunnelling.
However, for that to happen, the X client machine must be ssh-able.

That means if I want to use my work machine at home, I must be able to
start ssh at home to the work machine. And this is exactly my problem.
My work machine is behind a firewall. I can do the reverse very
nicely, though - i.e., ssh from work to home and start xterm, which is
displayed on the work screen.

So, what I'm thinking is ssh port forwarding using the -L flag. I know
that X listens to port 6000 for :0, 6001 for :1, and so on. But the
following won't work:

home> xhost +work
work> ssh -L 6001:127.0.0.1:6001 home
work> xterm -display :1
xterm Xt error: Can't open display: :1

I checked using netstat to make sure that my work machine is listening
to port 6001. Doing "telnet work 6001" also establishes a valid
connection that gets tunnelled to home:6001.

Could someone tell me what I've done wrong or how I can access my work
machine with X/ssh please?

Thanks in advance.

Regards
Kevin



Relevant Pages

  • Re: Warning: No xauth data after upgrading to Solaris 10 GA
    ... When I ssh into a Solaris 10 machine, ... successfully get an IPv6 binding, and then an IPv4 binding, but every ... by convincing the ssh daemon to run with the -4 flag. ...
    (comp.unix.solaris)
  • Re: avoiding authenticity prompt
    ... > We use ssh as part of our batch scripts and occasionally come across a ... The '-o' flag will certainly work as mentioned in another post, ... Take a look at ssh-keyscan to build your .known-hosts file. ... a machine is compromized and the ssh key changed, ...
    (SSH)
  • Re: 6.0-release remote x application failure to open display
    ... I think this is probably a simple question, but I do not recall having ... I have tried with passing the -X flag, and with passing the -Y flag to ... ssh, but there is no change in behaviour. ...
    (freebsd-questions)
  • Re: remote execution with TCL
    ... Using ssh without passwords? ... pass the -n flag to ssh so that failure to use the key ... results in immediate failure and not a hang. ...
    (comp.lang.tcl)
  • ssh and X11
    ... I have a problem opening an Xterm window on my Suse linux machine ... after I ssh to a remote machine. ... In fact I lose keyboard input capabilities in the window where I ...
    (comp.security.ssh)