简体   繁体   中英

Adding SSH keys to SSH-Agent in Git Windows

I am trying to add an ssh key to the git ssh-agent in windows, from powershell. However, when I add it it adds it to the regular SSH agent but not the git one. I read this stackoverflow answer of it using a different SSH-agent. I tried starting the agent running C:\Program Files\Git\cmd>.\start-ssh-agent.cmd and it starts properly however when i try to do any ssh-add commands I get the error:

Error connecting to agent: No such file or directory

All the docs I have found is of adding the key to the.ssh file and then starting the ssh agent. is there a way to get files outside that directory in the Git SSH agent?

From this issue I was able to find that you can change git to use the windows ssh agent by running the following command git config --global core.sshCommand "'C:\Windows\System32\OpenSSH\ssh.exe'"

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