简体   繁体   中英

How to use on windows ssh key for git created on linux?

I'm using ubuntu linux 11.10. Generated private key following these steps .

Now I want to use same key on windows which has msysgit installed.

Tried copying "~/.ssh/id_rsa" to "C:/Users/user_name/.ssh/id_rsa", but that didn't help.

Where to go next?

First check if you have .pub there also. If you do and keep on having issues, this is how I've done something similar:

  1. > $GIT_PATH\\bin\\ssh-agent (it should be in the bin folder of your git installation, if you chose correctly when installing msysgit)
  2. > $GIT_PATH\\bin\\ssh-add "%USERPROFILE%\\.ssh\\id_rsa" (should say key was successfully added)

and retest. If ssh-add says it couldn't contact ssh agent, try setting the environment variables that running ssh-agent outputted (it should've outputted something like "SSH_AUTH_SOCK=something", so set that with "set SSH_AUTH_SOCK=something") and retry.

My ssh-add says that it couldn't contact ssh agent. Yet, I can git over ssh without the annoying password request. This is because id_rsa is captured automatically. I can add other rsa/dsa files as IdentityFile fileds in ~HOME/.ssh/config file.

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