HI gang, I would like to be able to setup some kind of tunnel so that I can use SSH to log into my machine at home and forward the X11 display. Currently, I can successfully SSH into my firewall, and from there either telnet or SSH into the machine of interest on my home network. This works OK for text but not for X. So, let's say for sake of argument that I am on a computer at the Linux Showcase in California. How can I set this up so that I can tunnel through my home firewall to the machine of interest on my home network and have the X display from the home machine forward to the machine at the conference? I think its just a matter of syntax on the SSH command line, but I can't seem to get it right. FYI, I'm using OpenSSH version 2.9.9p2, which I believe is the latest. Thanks in advance, Andy -- Andy Stewart Founder Worcester Linux Users' Group Worcester, MA, USA http://www.wlug.org
On Thu, Nov 01, 2001 at 11:17:10PM -0500, Andy Stewart wrote: andystewart> Currently, I can successfully SSH into my firewall, and from there either andystewart> telnet or SSH into the machine of interest on my home network. This works andystewart> OK for text but not for X. You could set up the firewall to do port forwarding to your machine of interest. Then you would just ssh to the firewall on some unused port number (say 33) and the firewall would forward your request to your machine of interest, port 22. I haven't actually done this on Linux (only BSD), but I believe iptables will do it. For ipchains, I've read that you can do it with the ipmasqadm and/por portfw programs, but they don't seem to come with Red Hat...
Andy Stewart <andystewart@mediaone.net> writes:
I would like to be able to setup some kind of tunnel so that I can use SSH to log into my machine at home and forward the X11 display.
Currently, I can successfully SSH into my firewall, and from there either telnet or SSH into the machine of interest on my home network. This works OK for text but not for X.
So, let's say for sake of argument that I am on a computer at the Linux Showcase in California. How can I set this up so that I can tunnel through my home firewall to the machine of interest on my home network and have the X display from the home machine forward to the machine at the conference? I think its just a matter of syntax on the SSH command line, but I can't seem to get it right.
ssh does X forwarding. For example: ssh -X <hostname> <command> will auto-forward the X connections over the secure connection. Now, if you want to automate it with your firewall, you could do like Chuck suggested, and have iptables forward a connection on an alternate port to an internal machine's port 22. This might be the best way, so you don't have to ssh to the firewall, then ssh to your internal host. but, if you don't mind multiple ssh connections, this works: ssh -C -t -A -X <host1> ssh -t -A -X host2 <command> -C == compression -t == allocate tty (otherwise the second ssh complains there is no terminal. -A == agent forwarding, not sure if you use the agent (it rocks!) -X == X forwarding I do this kind of thing, and it works well. keep in mind, that you may need to enable X forwarding on the server side in /etc/ssh/sshd_config good luck, -- Josh Huber
participants (3)
-
Andy Stewart
-
Charles R . Anderson
-
Josh Huber