Douglas Kojetin [EMAIL PROTECTED] wrote: > hi all- > > i ssh to a computer computer behind a firewall that has access to other > computers behind the network that i frequently need to ssh to. what i > normally do is > > ssh [EMAIL PROTECTED] > ssh [EMAIL PROTECTED]
Write a simple script that does this:
ssh -L 2222:secondcomputer:22 -f [EMAIL PROTECTED] sleep 60 && \
ssh -p 2222 [EMAIL PROTECTED]
Or just make it an alias, or something.
What it does is set up a port forward to the second computer through
port 2222 on localhost. So, if you connect to port 2222 on localhost,
the packets will be forwarded to port 22 on second computer. -f says
'go into the background' so that the prompt comes back to you on your
local system, while executing the sleep on the remote host. This keeps
port 2222 open on localhost for 60 seconds. If you do not connect to
that port in that time, the port will go away. If it doesn't take long
to make the connection, shorten that time.
Oh, and I'm assuming that the username is the same on both hosts.
Mike
--
"If life hands you lemons, YOU BLOW THOSE LEMONS TO BITS WITH
YOUR LASER CANNONS!" -- Brak
GNUPG Key fingerprint = ACD2 2F2F C151 FB35 B3AF C821 89C4 DF9A 5DDD 95D1
GNUPG Key = http://www.enoch.org/mike/mike.pubkey.asc
pgp00000.pgp
Description: PGP signature
-- TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug TriLUG Organizational FAQ : http://trilug.org/faq/ TriLUG Member Services FAQ : http://members.trilug.org/services_faq/ TriLUG PGP Keyring : http://trilug.org/~chrish/trilug.asc
