Search code examples
sshssh-agent

how add public key to ssh-agent permanently


I added my existed public key to ssh-agent but after restarting I need to run

ssh-add ~/.ssh/id_rsa

to add it again. Is there a way to add it permanently?


Solution

  • You can not do that. You would need some secure store for the passphrase and you don't have it in ssh-agent. By storing the passphrase in plaintext, you basically downgrade the security to none (and you would better do by removing the passphrase completely).

    There are applications in GNOME that store the passphrase securely encrypted with the account password (gnome-keyring, seahorse), but pure ssh-agent does not know that.