Last active
April 21, 2023 08:37
-
-
Save kabouzeid/9b2744bd2e783ff66847135335b00fa8 to your computer and use it in GitHub Desktop.
Launch agent to add ssh keys to the agent on login.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>codes.ka.ssh-add-keychain</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/bin/ssh-add</string> | |
<string>--apple-load-keychain</string> | |
</array> | |
<key>RunAtLoad</key> | |
<true/> | |
</dict> | |
</plist> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Move into
~/Library/LaunchAgents
to load on login.This adds all key's to the
ssh-agent
. Note that thessh
command already does that whenAddKeysToAgent yes
is set, but other commands, such asgit commit -S
, do not. So after a reboot, when yougit commit -S
before usingssh
for the first time, it will not work and instead fail witherror: Load key "/var/folders/[...]/.git_signing_key_tmp[...]": invalid format?
. This launch agent fixes that.