1つのコマンドラインで2つのサーバーと1人のユーザーを介したSSH

1つのコマンドラインで2つのサーバーと1人のユーザーを介したSSH

重複の可能性:
SSH経由で他のコンピュータに接続する方法

1つのコマンドラインで次のことをどのように実行できますか?

$SSHサーバー1
$ su - ユーザー
$SSHサーバー2

もちろん直接はできませんが、ssh user@server-two

ベストアンサー1

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

から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.

おすすめ記事