Ssh-agent not working via gnome-keyring

I did encounter the problem with ssh-agent not working via gnome-keyring anymore. I tried the solution that is mentioned in the link using gcr-4 and socket and service are running but yet I have to enter my key password every time.

I hope you guys come up with a solution that works for script kiddies like myself O:-)

I added this to my ssh config:

Host *
	AddKeysToAgent yes

So I have to enter my ssh-key password ones (boot or restart)

Hm, doesn’t seem to work on my machine. But I’m not sure if this is the right place to discuss this issue. Also I’m kind of puzzled there is so little feedback regarding this. Is not encrypting an ssh key a thing right now?

Same thing happening to me. Tried the fix/workaround and it didn’t help. Also tried the “AddKeysToAgent” addition in the config. Still have to put the key password in each time I connect to a system via SSH.

I have them in keepassxc and they get auto-added when db is opened.

Interesting. This is not affected by the issue at hand? I have to say I didn’t look into this whole subject very deeply so far but I guess I will have to now. I’m kind of confused between the functionality of gnome-keyring, ssh-agent and gcr-ssh-agent.

The only way I get it to run ist to start ssh-agent manually in the terminal using eval $(ssh-agent) and then entering the passphrase once. But that only works within the one terminal session. I have a script running in my cinnamon panel via CommandRunner and that needs the ssh key unlocked as well. That worked beautifully by asking the passphrase once after login but now it’s dead.

Update: Looks like even more-sophisticated-than-me people are not happy with the situation and can’t get it to work with gcr-4. So I guess I hope this decision will be reverted soon.

So it seems like the problem for me is the environment variable. I’ve tried putting it in numerous places (.bash_profile, .profile, etc) and it doesn’t seem to work. If I open up a terminal and immediately try to SSH, I have to plug in the password. If I manually set the environment variable for SSH_AUTH_SOCK, I don’t have to type the password to the key.

1 Like

Ok I got it to work with this:

sudo echo “export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/gcr/ssh” > /etc/profile.d/
systemctl --user enable gcr-ssh-agent.socket
systemctl --user enable gcr-ssh-agent.service

Not sure why but all the other files mentioned in the links above didn’t seem to be pulled in time. Now I get asked for the passphrase right after reboot when CommandRunner first executes my panel script and then only after the next reboot.

So I guess setting this by default is probably the easiest way forward for the Manjaro team, right?

1 Like

I think I figured out my problem. Turns out in ~/.bashrc I had the line export SSH_AUTH_SOCK=“$XDG_RUNTIME_DIR/keyring/ssh”

I changed it to be export SSH_AUTH_SOCK=“$XDG_RUNTIME_DIR/gcr/ssh”

So far so good. Not sure how/when I edited .bashrc to have that in there. If I recall I had a similar keyring issue a while ago and that fixed it.

You had it probably in the .profile file which is now now read by lightdm.
Add the auth socket to .xprofile and it should work.

1 Like

I don’t have a .xprofile but plenty other .files so I prefer the /etc-solution as long as that works. But thank you for the hint!

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.