回答:
一般的に、あなたはいつでも行うことができます:
<command> | ssh user@remote-server "cat > output.txt"
リモートサーバーのファイルに出力<command>をoutput.txt保存します。
あなたの場合、Server-1で:
echo "qwerty" | ssh user@Server-2 "cat > output.txt"
2つのサーバーに接続がないが、両方のサーバーにSSHで接続できる場合は、ローカルマシンから次のように実行できます。
ssh user@Server-1 "<command>" | ssh user@Server-2 "cat > output.txt"
以下を実行できます。
ssh remote_server "command" > file_on_local_host.txt
または、ローカルコマンドの入力として出力を使用します。
ssh remote_server "remote_command" | local_command