ssh-add no es persistente entre reinicios

Agregué una clave ssh al agente por:

$ ssh-add ~/.ssh/id_rsa_mac
Identity added: /Users/alex/.ssh/id_rsa_mac (/Users/alex/.ssh/id_rsa_mac)

Después de reiniciar, el agente ya no tiene esta clave agregada:

$ ssh-add -l
The agent has no identities.

¿Por qué pasó esto?

Mejor respuesta
La adición de claves al agente es transitoria. Solo duran mientras el agente se está ejecutando. Si lo mata o reinicia su computadora, se perderán hasta que los vuelva a agregar. Desde la página de manual de ssh-agent:

ssh-agent is a program to hold private keys used for public key authentication (RSA, DSA, ECDSA). The idea is that ssh-agent is started in
the beginning of an X-session or a login session, and all other windows or programs are started as clients to the ssh-agent program. Through
use of environment variables the agent can be located and automatically used for authentication when logging in to other machines using
ssh(1).

The agent initially does not have any private keys. Keys are added using ssh-add(1). When executed without arguments, ssh-add(1) adds the
files ~/.ssh/id_rsa, ~/.ssh/id_dsa, ~/.ssh/id_ecdsa and ~/.ssh/identity. If the identity has a passphrase, ssh-add(1) asks for the
passphrase on the terminal if it has one or from a small X11 program if running under X11. If neither of these is the case then the authentication will fail. It then sends the identity to the agent. Several identities can be stored in the agent; the agent can automatically use
any of these identities. ssh-add -l displays the identities currently held by the agent.

macOS Sierra

Starting with macOS Sierra 10.12.2, Apple ha agregado una opción de configuración UseKeychain para configuraciones SSH.
Puede activar esta función agregando UseKeychain yes a su ~ / .ssh / config.

Host *
  UseKeychain yes

Llavero OSX

No utilizo OSX pero encontré este Q > A en SuperUser titulado: How to use Mac OS X Keychain with SSH keys?.

I understand that since Mac OS X Leopard the Keychain has supported storing SSH keys. Could someone please explain how this feature is supposed to work.

Entonces, por lo que parece, podría importar sus claves SSH en Keychain usando este comando:

$ ssh-add -K [path/to/private SSH key]

Sus claves deberían persistir de arranque a arranque.

Whenever you reboot your Mac, all the SSH keys in your keychain will be automatically loaded. You should be able to see the keys in the Keychain Access app, as well as from the command line via:

06002

Fuente: Super User – How to use Mac OS X Keychain with SSH keys?

Por favor indique la dirección original:ssh-add no es persistente entre reinicios - Código de registro