Constantly asked for SSH keys' password

Hey guys,

I am constantly asked for SSH keys’ password. Say I do a push in a git repo. Then immediately after, if I try to do another push, it will re-ask for my password, which is really annoying. I would like for it to remember it, somehow.

What software do you use for this?

ssh-agent

Try:

eval `ssh-agent`
ssh-add /path/to/ssh-key

It should ask you for your password once than just work after that.

1 Like

By ssh-agent, you mean this, right?:

extra/keychain 2.8.5-2 [23.20KB 53.80KB] [Installed]

EDIT:

Ya, this works. Though after doing a git push, the key should be added to the keychain automatically. Is there no way to have the keys added to the keychain automatically, without having to do ssh-add and inputing the password everytime I login?

Just to be clear, are you saying you want to never have enter a password when you use that ssh key?

If so, you could just remove the password from the ssh-key. It obviously lowers the security but so does never entering a password.

No. I want to enter the password exactly once, the first time I use it. I use the key for the first time since I logged in, it asks for password. After that, it shouldn’t ask for password until I relog.

That is slightly different than calling ssh-add before using the key.

I have been dealing with similar issues and this is what I have found:

A walkthrough of some options on stackoverflow and it mentions using ssh-add ~/.ssh/id_rsa and adding your key that way for linux. There is a mention for macOS of ssh-add -K

I also checked out the Arch wiki and found some similar documentation for adding the key. But they mention running eval $(ssh-agent) to see if it brings up a number. I don’t fully understand that part yet since I have a number that pops up, but I might also check this out. Hope some of this helps, also seen some similar issues.

What you are describing is what I mentioned in the second post, using ssh-agent for key management.

What the OP was requesting is for it to automatically cache his credentials without having to call ssh-add.

That launches the ssh-agent process and returns the process ID. Essentially, ssh-agent runs in the background after that.

ssh-add is the command which loads the keys into the agent

Thanks for the additional info. I’m still learning ssh for Devops and development stuff.

I know I’d like a similar setup to what I had on pop os where I never had to enter my key after a certain point. Now it’s every time I launch the terminal.

That said I need to double check but I believe that means your got commits get the verified badge that way.

I’m using Xfce, not i3wm, so the process may be somewhat different. However, with EOS, I found I had to install polkit-gnome. With that in, my first SSH login after a boot I get prompted tor the key password, after which it is automatically used until the next boot.