Ubuntu – How to automatically unlock private SSH key

keyringssshunlock

I have generated an RSA public / private key pair using ssh-keygen. However, I am prompted to enter the password to unlock it the first time it is used each session. How can I automatically have it unlocked after login?

Even better: since this is running on an Ubuntu server, it would be great if it was never locked at all – that way the automated daemons that need it would not require manual intervention to use it.

Best Answer

I may be mistaken here, but it sounds like what you're trying to do is to not need to unlock your key every time it is used?

If that's the case, it seems like the easiest solution would be to just not create a passphrase while creating the key. i.e. run

ssh-keygen

and when it asks for a passphrase, just press enter twice. I apologize if this is too simplistic, but it's what I've always done when creating keys so I don't need to unlock them. Hope it helps!