[OT] Re: udev and devfs - The final word

From: Disconnect
Date: Tue Jan 06 2004 - 12:29:37 EST


On Mon, 2004-01-05 at 19:14, Rob Landley wrote:
> You can run any tcp/ip service over ssh.
>
> Yeah, the script's a quick and dirty hack, but really easy to modify. I have
> a more complicated one using SO_ORIGINAL_DEST and a lookup table if you
> prefer to setup some firewall rules and tell your imap server it lives in the
> 192.168.x.x or 10.x.x.x address range... But I've never gotten around to
> configuring my laptop to use it just to tunnel pop. :)

simpler:
ssh -L<local>:127.0.0.1:<remote> [-C] user@host

eg I forward imap from home (not accessible outside localhost) and
jabber from a second machine at home:
ssh -L143:localhost:143 -L5222:jabber:5222 -C dis@home

Then just point the client at localhost:143 (or 5222) and it 'just
works'. No python required.

For an added bonus, run a script on the far side that does something
like:
while /bin/true; do
if [ -f .dienow ]; then
rm -f .dienow
exit
else sleep 60
done
and on the local side:
while /bin/true; do
ssh -L1:localhost:2 etc user@host ./remotescript
sleep 1
if [ -f .dienow ]; do
scp .dienow user@host: && rm -f .dienow
done
done

..respawn the ssh forwards until it finds ~/.dienow (-and- the current
ssh exits) and then kill off both sides. Don't flood the system by
respawning ssh more than once per 1-2 seconds. (And who said you
couldn't vpn with shell? You can even add/remove ports along the way, if
you get creative.)

--
Disconnect <lkml@xxxxxxxxxxx>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/