Skip to content

Instantly share code, notes, and snippets.

@scalp42
Forked from mmasashi/.sshrc
Created March 28, 2014 02:47
Show Gist options
  • Select an option

  • Save scalp42/9824180 to your computer and use it in GitHub Desktop.

Select an option

Save scalp42/9824180 to your computer and use it in GitHub Desktop.
# 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