This is a follow-up to this question: GNOME keyring daemon sometimes not asking for passphrase, need to provide it via command line

Is there a command to force the gnome-keyring-daemon to ask for my passphrase for my private key(s), without logging in to any SSH server?


If you have ssh-askpass installed (or a variant like seahorse-ssh-askpass), you can force a prompt by adding your key to the keyring with ssh-add. Note that to get a graphical/UI prompt, you need to disable standard input, because ssh-add will read input from the connected terminal if it is available.

# will use SSH_ASKPASS, or ssh-askpass by default
ssh-add ~/.ssh/id_rsa </dev/null

# use seahorse's prompt utility
SSH_ASKPASS=/usr/lib/seahorse/seahorse-ssh-askpass ssh-add ~/.ssh/id_rsa </dev/null

Note that seahorse itself provides a UI for managing secrets backed by gnome-keyring-daemon, but the main program is not meant for a one-shot prompt-and-save operation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.