0

Git allows using an RSA fingerprint or ED25519 to do a pull or push to GitHub. When adding the key and pushing for the first time, we are asked (via a modal box of Ubuntu's GUI) if we want Git to remember the password we set for that key, instead of having to type it each time. If you forget to put a tick on that checkbox for remembering the password, you'll have to type the password every time you do a pull or push to GitHub.

Which file or folder contains that setting for remembering the password? Is it Gnome Keyring? I want to delete that setting, so that the next time I do a push or pull, I want it to ask me again if I want it to remember the password, and this time I want to put a tick mark on that checkbox.

I already searched .ssh folder and deleted the known_hosts file. Also looked into some of the Gnome folders of .cache and .config, but couldn't find anything that'd give me a clue as to where that setting is stored. This is on Ubuntu 16.04.

I think this was the modal box:
enter image description here I want it to prompt me again. I've already tried deleting the .pub file and deleting the key from GitHub and re-creating the key. But the modal box does not appear again.

2 Answers 2

0

There is no such setting – the behavior is just based on the current existence of a "remembered" password. GNOME Keyring attempts to load all keys from ~/.ssh/id_*. If the keyring contains a password for the SSH key, it is automatically used; if the keyring doesn't contain one, you get the graphical dialog box. (Use seahorse to manage saved passwords.)

The behavior of GNOME Keyring changed in later releases, but in general it only auto-loads keys from ~/.ssh/, everything else needs to be manually loaded using ssh-add.

This only works if the system is configured to use GNOME Keyring's SSH agent. If your $SSH_AUTH_SOCK is configured to use something else (e.g. plain ssh-agent), on-demand key loading is up to that "something else".

4
  • Thank you, but I didn't quite understand how to proceed. My system is configured to use Gnome Keyring's SSH agent. I opened the Passwords and Keys application just now and I saw one of my old SSH passwords there. I have not configured any other on-demand key loading. What setting do I need to change to make Gnome keyring ask for the "Automatically unlock this keyring whenever I'm logged in"?
    – Nav
    Commented Jun 15, 2022 at 10:32
  • As far as I know, there isn't any setting. It always asks. Commented Jun 15, 2022 at 10:37
  • The dialogue could be prevented by an extremely long “lock this key ring” timeout in theory since it would be assumed to be unlocked until locked.
    – Ramhound
    Commented Jun 15, 2022 at 10:58
  • I don't want to prevent the dialog. I want it to ask just once, and then I select the "Automatically unlock this keyring whenever I'm logged in" option. I don't want to type my SSH key's password every time I do a push or pull.
    – Nav
    Commented Jun 15, 2022 at 11:09
0

You would need to start ssh-agent and add the keys. That should cache the keys for the duration of the shell.

  1. eval $(ssh-agent)
  2. ssh-add <PATH_TO_SSH_KEY>

Found out about it here

1
  • 1
    Thank you. This is useful, but it only lasts for the duration of the shell being open. The solution I'm looking for, does not require typing the password ever again.
    – Nav
    Commented Sep 1, 2022 at 6:09

You must log in to answer this question.

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