Skip to content

Instantly share code, notes, and snippets.

@bylatt
Last active April 21, 2017 20:11
Show Gist options
  • Save bylatt/9ddcc9e256d27adffa8e26cf183f8296 to your computer and use it in GitHub Desktop.
Save bylatt/9ddcc9e256d27adffa8e26cf183f8296 to your computer and use it in GitHub Desktop.
autoload ssh key when login macOS
# Not recommend
# clear key
ssh-add -K -d ~/.ssh/<key>
# add key
ssh-add -K ~/.ssh/<key>
# add script to automaticcally add key when login
curl -o ~/Library/LaunchAgents/ssh.add.a.plist https://raw.githubusercontent.com/jirsbek/SSH-keys-in-macOS-Sierra-keychain/master/ssh.add.a.plist
# Use this config instead
Host * (asterisk for all hosts or add specific host)
AddKeysToAgent yes
UseKeychain yes
IdentityFile <key> (e.g. ~/.ssh/userKey)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment