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?

1 Answer 1


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.

  • 1
    What on Earth does SSH have to do with this? My understanding is that the GNOME keyring is a completely abstract secret store. Why is the name of a specific application (ssh) even present in this answer? Commented Nov 23, 2021 at 10:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .