git密匙有什么用,使用现有密钥配置Git
![Image 1][]
I have configured git with public and private key. I sent my public key to server guy.
Then I formatted my PC and installed windows again. But I saved my both keys on the hard drive before formatting system.
Now I want to reconfigure my Git using existing keys.
How can I do this????
解决方案
You simply need to copy your id_rsa and id_rsa.pub keys (that you previously saved) in C:\Users\YourAccount\.ssh (create the directory ‘.ssh’ if it doesn’t exist).
That path is what git-cmd.bat (in msysgit) defines at %HOME%, and ssh needs to look for your keys in %HOME%/.ssh.
Note that it is important for HOME to be defined by a msysgit session (a cmd or a git-bash), because Windows itself never defines the environment variable HOME (it uses USERPROFILE instead, which ssh known nothing about).
[Image 1]:
还没有评论,来说两句吧...