How to save password with Git ssh-agent

3.4k views Asked by At

Not sure how or why, but ssh-agent lost all saved passwords. How can I re-add them?

I would like it if when connecting over SSH to type the password then and have ssh-agent remember it from there on.

I use a config file for different hosts and as far as I remember I didn't have to ssh-add for any of the entries there but rather type the password once and then the agent remembered it.

Thank you.

1

There are 1 answers

2
jarodeells On

If you are using a shell which didn't get created by the same shell as the one which spawned ssh-agent, then you need to set some env variables so ssh knows which agent to query.

They are displayed when you run ssh-agent for easy import into a new shell.

See http://mah.everybody.org/docs/ssh for more details.