Skip to content

Instantly share code, notes, and snippets.

@pipizhang
Created March 29, 2018 20:36
Show Gist options
  • Select an option

  • Save pipizhang/a0ea65e89330469a8bbdea660bf73db8 to your computer and use it in GitHub Desktop.

Select an option

Save pipizhang/a0ea65e89330469a8bbdea660bf73db8 to your computer and use it in GitHub Desktop.
Automated ssh-add without enter passphrase
#!/usr/bin/expect
#author PeterZhang
set pass "YOUR_PASSPHRASE"
spawn ssh-add $HOME/.ssh/id_rsa
expect "*passphrase*" {send "$pass\r"}
interact
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment