SSH Private Key Permissions using Git GUI or ssh-keygen are too open

前端 未结 25 1787
说谎
说谎 2020-12-07 06:57

Recently I\'ve been unable to clone or push to github, and I\'m trying to find the root cause.

This is on windows

I have cygwin + git as well as msy

25条回答
  •  無奈伤痛
    2020-12-07 07:26

    I'm on XP and this allowed Git Bash to communicate w/ Github (after much frustration):

    1. copy c:\cygwin\bin\cyg* (~50 files) to c:\Program Files\Git\bin\
    2. copy c:\cygwin\bin\ssh.exe to c:\Program Files\Git\bin\ (overwriting)
    3. Create the file c:\Documents and Settings\\.ssh\config containing:

      Host github.com
          User git
          Hostname github.com
          PreferredAuthentications publickey
          IdentityFile "/cygdrive/c/Documents and Settings//.ssh/id_rsa"
      
    4. (optional) Use ssh -v git@github to see the connection debugged.

    5. Try a push!

    Background: The general problem is a combination of these two:

    • BUG: mingw32 sees all files as 644 (other/group-readable), and nothing I tried in mingw32, cygwin, or Windows could fix it.
    • mingw32's SSH version won't allow that for private keys (generally a good policy in a server).

提交回复
热议问题