Since I updated to Ubuntu 17.10 a while ago, my private keys – the which I use for example to access my server via ssh – are not unlocked programmatically after login anymore.
My understanding is, that usually the seahorse client
should take care of this, by asking you whether or not to store the key's password when typing them in for the first time.
My first guess was, that seahorse-daemon
wasn't running for some reason, but it is:
user@Zeus:~$ ps aux | grep seahorse
user 19170 0.0 0.1 432636 26564 ? Ss 00:07 0:00 seahorse-daemon
My second guess was, that for some reason I have to delete all related passwords stored in seahorse under »Passwords->login«:
I was hoping to force the client to ask me again and then storing them again. But this didn't help either. The client does not pop up to ask me...
Then I found this question, which could be related, but did not help me: Unlock all private keys on Ubuntu, entering password only once at login
As the management of other passwords work as expected (for example passwords for nautilus, Chromium, Nextcloud etc.) I assume the problem has to do something with ssh-agent
...
Can anybody hint me in the right directions, how to solve this problem? Has anything changed in the way how GNOME handles passwords? Maybe some new fancy program failed being installed during the upgrade process?
UPDATE When I add the private key to the authentication agent again with:
ssh-add ~/.ssh/id_rsa
and try to log in, I will be asked to unlock the key only once, after that the key gets unlocked programmatically. But this works only until the next reboot. After a fresh start, I have to add the key again...
Yes, ssh-agent is the answer. To save the passphrase, all you have to do is:
Then put in your password, and log back in.
Adding SSH Key Agent (GNOME Keyring: SSH Agent) to Startup Applications solved the problem for me:
First Option
Start ssh agent :
Add the ssh-key :
To make it persist after reboot, auto start ssh-agent, add the following line to your .bash_profile :
Second Option
Add this to your .bashrc or .zshrc :
This should only prompt for a password the first time you login after each reboot. It will keep reusing the same ssh-agent as long as it stays running.