├── ssh.add.a.plist └── README.md /ssh.add.a.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Label 6 | ssh.add.a 7 | ProgramArguments 8 | 9 | ssh-add 10 | -A 11 | 12 | RunAtLoad 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Saving SSH keys in macOS Sierra keychain 2 | 3 | ## Source links 4 | - https://openradar.appspot.com/27348363 5 | - https://forums.developer.apple.com/thread/48794 6 | - http://testequals.com/2016/09/09/macos-sierra-10-12-ssh-keys/ 7 | - https://www.reddit.com/r/osx/comments/52zn5r/difficulties_with_sshagent_in_macos_sierra/ 8 | - https://forums.developer.apple.com/thread/48794 9 | 10 | ## Problem 11 | 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 `. 12 | 13 | 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."_ 14 | 15 | ## Solution 16 | There is a possible solution – to call command `ssh-add -A` on every startup of macOS. 17 | 18 | Just add .plist with the following content to the path `~/Library/LaunchAgents/` or create one with Lingon app (https://www.peterborgapps.com/lingon/): 19 | 20 | ``` 21 | 22 | 23 | 24 | 25 | Label 26 | ssh-add-a 27 | ProgramArguments 28 | 29 | ssh-add 30 | -A 31 | 32 | RunAtLoad 33 | 34 | 35 | 36 | 37 | 38 | ``` 39 | --------------------------------------------------------------------------------