LoginSignup
2
4

More than 5 years have passed since last update.

ssh-agent 自動起動(毎回パスフレーズ聞かれるのがうっとうしい人向け)

Last updated at Posted at 2016-04-03
  • windows7
  • cygwin
  • vagrant
  • centos

環境で開発してる際・・・・

winだから?cygwinだからか?
ssh-agentが自動起動しておらず、毎回sshでパスワード聞かれるのがうっとうしい。。。。
ので、bashに下記追記で地味にラクになった。

KEY_FILENAME='hogehoge'   # 秘密鍵ファイル
PASSPHRASE='XXXXXXXXXX' 

eval `ssh-agent`

expect -c "
set timeout -1
spawn ssh-add /home/Username/.ssh/$KEY_FILENAME
expect {
    \"Enter passphrase for\" {
        send \"$PASSPHRASE\r\"
    }
}
expect {
    \"denied\" { exit 1 }
    eof { exit 0 }
}
"

早くmacに変えたい。

2
4
2

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
2
4