パスワードを使用したSFTPスクリプト - HP-UX

パスワードを使用したSFTPスクリプト - HP-UX

パスワードを使用してsftpに送信するスクリプトをHP-UXで作成したいと思います。私はこのコマンドを持っています

sftp -o PasswordAuthentication=

ただし、「はい」または「いいえ」と答えると、「ホストキーの確認に失敗しました」という問題が発生します。

ベストアンサー1

socat便利な場合は、このマニュアルの例を使用できます。

   (sleep 5; echo PASSWORD; sleep 5; echo ls; sleep 1) |
   socat - EXEC:'ssh -l user server',pty,setsid,ctty

          EXEC’utes an ssh session to server. Uses a pty for communication
          between socat and ssh, makes it ssh’s controlling tty
          (ctty), and makes this pty the owner of a new process group 
          (setsid), so ssh accepts the password from socat.

おすすめ記事