Git Bash and Pageant are not using keys

后端 未结 6 1608
清歌不尽
清歌不尽 2020-11-30 21:28

I\'ve got Git for Windows (configured for MinTTY and PuTTY\\plink.exe) and PuTTY installed, and I am trying to get it to work with a Bitbucket repository. I\'ve

6条回答
  •  天涯浪人
    2020-11-30 22:08

    You don't need PuTTY to work with Bitbucket in ssh: the OpenSSH version (C:\prgs\git\PortableGit-2.7.0-64-bit\usr\bin\ssh.exe) packaged in git-for-windows works just fine.

    Make sure that, in your current shell session, you have HOME set to %USERPROFILE% (a PortableGit-2.7.0-64-bit\git-cmd.exe is enough to open a regular CMD properly configured).

    Create a file named config in %USERPROFILE%\.ssh (as in step 3 of the Atlassian documentation):

    Host bitbucket.org
     IdentityFile ~/.ssh/bitbucket_rsa
    

    (You can also use "/C/path/to/bitbucket_rsa".)

    That allows to use an SSH URL like bitbucket.org:user/repo. Test it with ssh -Tv bitbucket.org (after adding your public key to your Bitbucket account, of course).

    Note: ssh-agent is only needed if your private key is passphrase-protected.

    Update 2018, two years later: "Say Farewell to PuTTY as Microsoft adds an OpenSSH Client to Windows 10". It is really time to ditch putty aside: no need for a different (ppk) key format and proprietary solution, now that OpenSSH is officially distributed as a Windows feature (in beta for now, Q1 2018).

提交回复
热议问题