Skip to content

Instantly share code, notes, and snippets.

@mmasashi
Created December 5, 2013 22:45
Show Gist options
  • Save mmasashi/7815373 to your computer and use it in GitHub Desktop.
Save mmasashi/7815373 to your computer and use it in GitHub Desktop.
How to "ssh-add" without entering passphrase.
# ssh-settings
eval $(ssh-agent)
priv_path="$HOME/.ssh/ida_rsa"
passphrase="aaaa"
if [ "$passphrase" = "" ]; then
# without passphrase
ssh-add $priv_path
else
# with passphrase
expect << EOF
spawn ssh-add $priv_path
expect "Enter passphrase"
send "$passphrase\r"
expect eof
EOF
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment