MacOS – After running `ssh-add -K` to add the SSH key to the Apple Keychain, what is the name and type of entry shown in Keychain Access.app

keychainmacospasswordsshterminal

Supposedly this console command will add my private SSH key to the Apple Keychain, as discussed in this Answer on the Question, How to use Mac OS X Keychain with SSH keys?:

ssh-add -K path-to-my-private-key-for-SSH

If that succeeds…

➥ What is the type and name of the entry to be found in the Keychain Access.app?

I would like to be able to manually verify and possibly delete that entry.

Best Answer

I just got a brand new laptop (running Mojave) so I had the opportunity to try this without having to sort through a large Keychain. From what I can see, running ssh-add -K path/to/key does absolutely nothing to the Keychain. No new records were created after running the command.

I'm pretty mystified as to how OSX manages ssh-agent and I can't even get it to remember my keys (Ubuntu does this by default) between sessions. I'll come back and edit if I find a solution for you.

EDIT: If you key is not passphrase protected, it looks like OSX won't add it to the Keychain. Presumably this is because the only thing the keychain stores is the passphrase. Everything else seems to require messing with the ~/.ssh/config file.

EDIT: If your ssh key is passphrase protected, running ssh-add -K path/to/key adds your passphrase to your keychain as a generic password prepended with "SSH:" Also, as for remembering keys, starting with OSX Sierra, Apple chose to stop remembering keys by default. See a brief medium article (with some external sources) here.