Git can't find .ssh

后端 未结 5 2058
一整个雨季
一整个雨季 2021-02-08 08:46

Problem using msysgit on Windows; it can\'t find .ssh/id_rsa, even though it is present where it should be.

I verified that\'s the problem with ssh -v git@github.com; th

5条回答
  •  闹比i
    闹比i (楼主)
    2021-02-08 09:20

    I had this problem with git in Msys/MinGW where it couldn't find my private key, despite being able to ssh into the server fine.

    The problem was that the entry in ~/.ssh/config said:

    Host github.com
    IdentityFile /home/username/.ssh/id_rsa
    

    However Git required the full path from a Windows point of view like this instead:

    Host github.com
    IdentityFile c:/mingw/msys/1.0/home/username/.ssh/id_rsa
    

    and then it worked.

    To discover this path from msys, run cd ~/.ssh and then pwd -W

提交回复
热议问题