The --apple-use-keychain
option is in Apple's standard version of ssh-add
, which stores the passphrase in your keychain for you when you add an ssh key to the ssh-agent. If you have installed a different version of ssh-add
, it may lack support for --apple-use-keychain
.
Solving the issue
To add your SSH private key to the ssh-agent, you can specify the path to the Apple version of ssh-add
:
/usr/bin/ssh-add --apple-use-keychain ~/.ssh/id_ed25519
Notes:
- The
--apple-use-keychain
option is in Apple's standard version ofssh-add
. In MacOS versions prior to Monterey (12.0), use-K
instead of--apple-use-keychain
. - Se você criou sua chave com um nome diferente ou está adicionando uma chave existente que tenha outro nome, substitua id_rsa no comando pelo nome do arquivo de chave privada.
Further reading
- "Gerando uma nova chave SSH e adicionando-a ao agente SSH"
- Linux man page for ssh-add
- To view Apple's man page for SSH-ADD, run
man ssh-add
in Terminal