Problem with ssh-agent: ssh-agent does't work after close the git terminal on Windows 10

Viewed 876

Following the tutorial on the bitbucket, I have configured ssh-agent and saved my private key in ssh-agent on Windows 10.

To start the agent, run the following:
$ eval $(ssh-agent) 
Agent pid 9700      

Enter ssh-add followed by the path to the private key file:
$ ssh-add ~/.ssh/<private_key_file> 

but after closing the git terminal and reopen it, strange thing happened.

$ ssh-add -l
The agent has no identities.

By the way, under this condition, it still need to enter password of private key.

Could somebody tell me what happened and how to fix this problem.

1 Answers

Closing the terminal likely closed the ssh-agent.

You should follow "Auto-launching ssh-agent on Git for Windows" in order to make sure that, when reopening a git bash session, the .bashrc relaunch the ssh-agent automatically.

Related