Ssh: Prompt for passphrase the first time the ssh-key is used

From FVue
Jump to: navigation, search

Problem

Ssh used to prompt for the passphrase, the first time the ssh-key is used during a login session. After upgrading to Kubuntu-16.10, ssh doesn't do so anymore.

Environment

  • Kubuntu-16.10

Journal

20170106

ssh agent - How can I run ssh-add automatically, without password prompt? - Unix & Linux Stack Exchange
QA with multiple options how to setup ssh-add
GNOME/Keyring - ArchWiki
How to setup gnome-keyring

20170109

After adding this to .xinitrc:

eval $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)
export SSH_AUTH_SOCK

things do not work. This is probably because $SSH_AUTH_SOCK isn't pointing to the right file:

$ echo $SSH_AUTH_SOCK 
/tmp/ssh-Fj00SK7flHan/agent.2586

After manually issuing gnome-keyring-daemon, SSH_AUTH_SOCK points to /run/user/.. and things work well:

$ eval $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)
$ export SSH_AUTH_SOCK
$ echo $SSH_AUTH_SOCK 
/run/user/1001/keyring/ssh