Keyring no longer prompts for password when SSH-ing

I found this on the Arch wiki: https://wiki.archlinux.org/index.php/GNOME_Keyring

Basically, you run gnome-keyring-daemon -s to get your specific keyring value, then to your .bashrc, add:

SSH_AUTH_SOCK=`netstat -xl | grep -o '/run/user/yourusername/keyring-xxxxxxx.*/ssh$'`
[ -z "$SSH_AUTH_SOCK" ] || export SSH_AUTH_SOCK

This should make ssh ask you for your password through the keyring GUI.


I use ssh a lot, mostly between my Ubuntu workstation and another Ubuntu web server with all the websites I work on. I once came upon the same symptoms you are having, and it turned out to be something in the way I was running the terminal. I had created a custom shortcut to run gnome-terminal because I wanted to pass a certain command line. But I think I had the same problem running xterm.

When I ran the terminal from the built-in shortcut (Alt-Ctrl-T), or from the menu, it worked correctly and prompted me with a GUI dialog for the password, but when I ran it from my custom shortcut, it always asked from the terminal itself, and didn't remember it.