1

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
1

1 Answer 1

9

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.

2
  • Thank you. I've been meaning to find a solution to this issue for a while, and I just came across this. Much appreciated. Apr 7 at 7:16
  • 1
    @DarrylYoung you're welcome, happy to red it helped you! Apr 8 at 18:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .