LoginSignup
3
3

More than 5 years have passed since last update.

SSHをShellScriptで秘密鍵認証を使わずにパスフレーズを通す。

Last updated at Posted at 2013-04-11
auto_scp.sh

#!/bin/sh
expect -c ”
spawn scp data.txt user@192.168.xxx.xxx:/tmp/
expect {
  ¥”Are you sure you want to continue connecting (yes/no)?¥” {
    send ¥”yes¥r¥”
    expect ¥”password:¥”
    send ¥”(パスワード)¥r¥”
  } ¥”password:¥” {
    send ¥”(パスワード)¥r¥”
  }
}
interact
”
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3