ネストされたSSHによるSCPログイン

ネストされたSSHによるSCPログイン

SCPを使用してファイルを転送するネストされたSSH認証があります。ログインするには、次の手順に従う必要があります。

$ ssh external_user@external_host
// It prompts me for my external_password [a]
// It directly prompts me for my internal_user [b]
// Then it prompts a final time for my internal_password [c]

このようなSSHログインプロセスでファイルをSCPとして指定するにはどうすればよいですか? (注)ステップでアドレスを入力するinternal_hostとすぐに接続しようとしていて、アドレスを入力する必要があるというメッセージがすぐに表示されたため、アドレスを入力する必要はありませんでした。external_password[a]internal_hostinternal_username

(単に試してみると、scp external_user@external_host:myfile myfile間違った宛先に接続しているというメッセージが表示されます。)

SFTPも試してみましたが、それを行うと、sftp external_user@external_host私を要求するのではなく、私を要求するのではなく、メッセージと共にexternal_password追い出されます。invalid targetinternal_user

また、コメントの1つが提案したようにこの方法を試しましたが、scp -o ProxyJump=external_user@external_host test.txt internal_user@internal_host:test.txtコンテンツを入力した後も問題が発生しましたexternal_password

Received disconnect from UNKNOWN port 65535:11: Disconnection
Disconnected from UNKNOWN port 65535
ssh_exchange_identification: Connection closed by remote host

可能な解決策が見つかりましたが、エンドホスト()への依存関係が必要なため、私の場合は機能しませんが、lrzsz同様の状況で他のユーザーには機能できます。https://github.com/mtatton/zssh

ベストアンサー1

おすすめ記事