[TriLUG] ssh 'through' a firewall

Tanner Lovelace lovelace at wayfarer.org
Sat Apr 24 00:35:00 EDT 2004


Douglas Kojetin said the following on 4/23/04 7:29 PM:

> 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 user at firstcomputer
> ssh user at secondcomputer
> 
> is there a shortcut i can take so that i don't ssh twice?  i've setup 
> aliases and 'no-password authentication' to ease things, but it would be 
> nice to do the above in one command if possible.

You could have the first ssh execute the second.  If you just put the
two commands together, you'll noticed, however, that it doesn't work.
Ssh doesn't automatically allocate a psuedo-tty when executing a command
so you must force it to using the -t option.

So, try:

ssh -t user at firstcomputer ssh user at secondcomputer

That should do what you want.

Cheers,
Tanner
-- 
Tanner Lovelace       | Don't move! Or I'll fill ya full of... little
lovelace at wayfarer.org | yellow bolts of light! - Commander John Crichton



More information about the TriLUG mailing list