clearlinux / distribution

Placeholder repository to allow filing of general bugs/issues/etc against the Clear Linux OS for Intel Architecture linux distribution
522 stars 29 forks source link

Git credentials login through GNOME Keyring stopped working, `/usr/libexec/git-core/git-credential-libsecret` is missing #3109

Open volkertb opened 6 months ago

volkertb commented 6 months ago

Hello,

I noticed that since a certain Clear Linux OS update, the expected GNOME Keyring popup no longer pops up and prompts for the SSH private key password when Git tries to access an SSH private key. Instead, I have to enter the password as part of each Git command that requires access to the private key.

According to this answer on StackOverflow, GNOME Keyring depends on libsecret to handle this functionality these days.

And Git is supposed to have a credential helper for libsecret, but in Clear Linux OS, it appears to be missing, even when Git, GNOME and libsecret are installed.

The following command lists the available Git credential helpers:

ls -lh /usr/libexec/git-core/git-credential*

Which lists these:

-rwxr-xr-x 142 root root 9.2M May  4 14:06 /usr/libexec/git-core/git-credential
-rwxr-xr-x 142 root root 9.2M May  4 14:06 /usr/libexec/git-core/git-credential-cache
-rwxr-xr-x 142 root root 9.2M May  4 14:06 /usr/libexec/git-core/git-credential-cache--daemon
-rwxr-xr-x 142 root root 9.2M May  4 14:06 /usr/libexec/git-core/git-credential-store

The missing one is /usr/libexec/git-core/git-credential-libsecret. I can enter the command git config --global credential.helper libsecret, but Git keeps prompting for key passphrases on each command that needs it, which is probably because git-credential-libsecret is missing.

I also used a couple of swupd commands to find a possible bundle that might provide this, but none of these showed up anything (other than mostly development bundles or bundles that are already installed):

swupd search gnome
swupd search ssh
swupd search secret
swupd search libsecret
swupd search gcr
swupd search gnome
swupd search credential
swupd search credentials
swupd search git
swupd search secret
swupd search keyring
swupd search keychain

Any idea why the libsecret credential helper for Git is missing, and could this maybe be restored? I guess I could use git-credential-cache for the time being, but GNOME Keyring has some advantages in terms of convenience.

Thank you kindly in advance.

volkertb commented 6 months ago

Okay, it looks like I misunderstood something about the credential helpers. Apparently the credential helpers (are at least some of them?) only apply to Git HTTP(S) authentication credentials, and not for the passwords (or passphrases) of private keys in the case of Git SSH authentication. But even then, why is the libsecret credential helper missing in Clear Linux OS?

volkertb commented 6 months ago

OK, for people stumbling upon this thread through a search engine: This in part to this discussion on StackOverflow and this Arch Linux forum thread, I managed to have GNOME Keyring working again for remembering SSH passphrases, by running the following commands, and rebooting afterwards:

systemctl enable --user gcr-ssh-agent.service
systemctl enable --user gcr-ssh-agent.socker
systemctl enable --user gcr-ssh-agent.socket
systemctl start --user gcr-ssh-agent.socket
systemctl start --user gcr-ssh-agent.server
systemctl start --user gcr-ssh-agent.service
systemctl status --user gcr-ssh-agent.socket
systemctl status --user gcr-ssh-agent.socket
systemctl --user status gnome-keyring-daemon.service
systemctl --user enable gnome-keyring-daemon.service
systemctl --user start gnome-keyring-daemon.service
systemctl --user status gnome-keyring-daemon.socket
systemctl --user enable gnome-keyring-daemon.socket
sudo reboot

In all likelyhood, just the following would probably have been enough (I noticed that they were disabled in my system for some reason, which may have had to do something with the fact that I had uninstalled and then reinstalled the desktop bundles from my Clear Linux OS system recently):

systemctl --user enable gcr-ssh-agent
systemctl --user enable gnome-keyring-daemon
sudo reboot

Instead of rebooting, just logging out and back in might also have worked, although I didn't try that.

So the case of git-credential-libsecret missing is unrelated to this, since the Git Credentials Helpers are only for managing HTTP authentication passwords, not SSH authentication private key passphrases. But perhaps you can look into that regardless, since the libsecret credentials helper is supposed to be included with Git? Otherwise, feel free to close this issue.

Thanks!