Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
サーバーAからサーバーBに直接ファイルを転送したい。この操作を実行するスクリプトは、Cなどの他のサーバーに常駐しています。サーバーCまたはローカルシステムにファイルを一時的に保存せずに、どのように実現できますか..
サーバーごとにsshキーのペアを作成し、ssh-copy-idを使用して公開キーをサーバーAからサーバーBに、サーバーCからサーバーAにコピーします。
次に行う必要があるのは、スクリプトにリモートサーバーAにsshを実行してから、scpを実行してファイルをサーバーBにコピーするように指示することです。
編集:パスフレーズなしでsshキーを設定する必要があります!(または、サーバーCとサーバーAでssh-agentを使用します)