Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Great tip - here is an extension.' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Great tip - here is an extension.
Authored by: Eponymous on Feb 06, '03 09:08:33PM
Yes, this indeed works fine in the terminal:
ssh -l USERNAME TUNNEL_HOST_IP -L LOCAL_PORT_NUMBER:REMOTE_SERVER:REMOTE_PORT_NUMBER
where username is your name on the tunnel machine, tunnel_host_ip is the ip address or name of the intermediate (tunneling) computer, local_port_number is the port number you'll use locally to connect to the remote_server at its remote_port_number. If you have the same username on your local and tunnel computers, then you don't need the "-l USERNAME" part; it'll just assume it. For example I connect to remote port 548 (appletalk) and put it at local port 1548. Then I use "Connect to server" to connect to afp://localhost:1548 and there's my remote machine, tunneled through my tunnel computer. (Actually I have the remote computer listed in my favorites, so that once I've established the tunnel, I can just get at it that way; without the tunnel, I get an error about the favorites alias.) So it goes: local computer at port 1548 tunnel computer remote computer at port 548 I'd love to do this with an applescript so I don't have to have the terminal running, but I always have trouble with getting shell scripts to work properly if they're at all complicated. (A good tutorial for this is needed.) Is there a way to give your password in the ssh command? I didn't find one in the man pages. Fugu also handles this pretty well, though it doesn't yet remember enough of the settings, nor is it apple-scriptable. You have to leave Fugu and Terminal running after you set up the tunnel, so I think I'll stick with the terminal, because I have it open usually anyway. I just put a line in aliases.mine to spare me typing out the whole damn thing each time. (PS You can also set your ssh server on the tunneling computer to use a different port (22 is the standard one), in case you have a firewall at work, as I do. Just add "-p TUNNEL_PORT_NUMBER" right after ssh in the command.)

[ Reply to This | # ]