I tried to add this to ~/.ssh/config file, but it doesn't help. Seems like it doesn't work for macOS Monterey anymore.
Host *
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa
UseKeychain yes
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.
Sign up to join this communityI tried to add this to ~/.ssh/config file, but it doesn't help. Seems like it doesn't work for macOS Monterey anymore.
Host *
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa
UseKeychain yes
Prior to MacOS Monterrey the -K
flag was used to add the key to the agent but since then and now in the new MacOS Ventura 13, we have a couple of different and more descriptive options:
--apple-use-keychain
--apple-load-keychain
The
-K
and-A
flags are deprecated and have been replaced by the these new flags, respectively.
Now, I also had to add this line to my .zshrc
file in order for ssh-add
to load my passphrase on every session:
ssh-add --apple-load-keychain -q
The -q
flag is to prevent from showing this message in every shell session but not a must:
Identity added: /Users/alex/.ssh/id_ed25519 (my@email.com)
Hopefully it will save some time to someone in the same situation as me after OS X upgrade.