Skip to content

imalberto/SSH-keys-in-macOS-Sierra-keychain

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Saving SSH keys in macOS Sierra keychain

Source links

Problem

As described in detail on https://openradar.appspot.com/27348363, macOS/OS X till Yosemite used to remember SSH keys added by command ssh-add -K <key>.

Unfortunately this way no longer works and command ssh-add -K in macOS Sierra no longer saves SSH keys in OS's keychain. As Apple Developer stated: "That’s expected. We re-aligned our behavior with the mainstream OpenSSH in this area."

Solution

There is a possible solution – to call command ssh-add -A on every startup of macOS.

Just add .plist with the following content to the path ~/Library/LaunchAgents/ or create one with Lingon app (https://www.peterborgapps.com/lingon/):

<?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>ssh-add-a</string>
	<key>ProgramArguments</key>
	<array>
		<string>ssh-add</string>
		<string>-A</string>
	</array>
	<key>RunAtLoad</key>
	<true/>
</dict>
</plist>

<!-- @@@@LingonWhatStart:ssh-add -A@@@@LingonWhatEnd -->

About

Saving SSH keys in macOS Sierra keychain

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published