简体   繁体   中英

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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM