1

Possible Duplicate:
How do I connect to a pc through another pc using ssh

How to go about doing in one command line the following operations?

$ ssh server-one
$ su - user
$ ssh server-two

Of course I cannot directly ssh user@server-two

1
6
ssh server-one -t ssh user@localhost -t ssh server-two

From man ssh:

     -t      Force pseudo-tty allocation.  This can be 
             used to execute arbitrary screen-based programs 
             on a remote machine, which can be very useful, 
             e.g. when implementing menu services.  Multiple -t
             options force tty allocation, even if ssh has no local tty.
2
ssh -t server-one 'su - user -c "ssh server-two"'

Not the answer you're looking for? Browse other questions tagged or ask your own question.