Skip to content

Instantly share code, notes, and snippets.

@clozed2u
Last active Apr 21, 2017
Embed
What would you like to do?
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