Can't manage to load my private key with git e

2020-06-09 07:10发布

I've been trying for the last 2 hours. I'm using xp-dev as a git repository provider (because I'm already paying and I have svn repo over there) I've given xp-dev my public key.

But when cloning my repo I a being rejected.

"C:\Program Files (x86)\Git\bin\git.exe" clone -v --recurse-submodules --progress "ssh://xp-dev.com/repogit" "c:/ProjetPerso/repogit"
Cloning into 'c:/ProjetPerso/repogit'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Done

And from what I understood from various blogs, git extension should ask me to load my private key, except it doesn't.

I tried launching the putty authentification client (even though I choose openSSH) and loaded my private key inside, but it changes nothing.

Any ideas?

Thanks.

4条回答
Bombasti
2楼-- · 2020-06-09 07:38

I had this issue because I generated a SSH key with ssh-keygen and tried to use it with GitExtensions which only understands OpenSSH keys.

What you have to do is, from GitExtensions:

  • Tools > Putty > Generate or import key (A new window opens)
  • Conversions > Import key
  • Import your private key
  • Save private key
  • Type a file name like mykey.ppk

You should now able to use this new .ppk file in GitExtensions!

查看更多
仙女界的扛把子
3楼-- · 2020-06-09 07:46

I faced this issue now. I was able to get the solution via the following link from GitExtension itself.

PuTTy and Github

Same would also work of GitLab. You will need to add generated ppk file to GitHub or GitLab under settings page.

查看更多
不美不萌又怎样
4楼-- · 2020-06-09 07:49

It is pretty easy to do this with Git-Extensions;

  1. Open Git Gui
  2. Help > Show SSH key
  3. Generate Key
  4. Copy To Clipboard
  5. Paste it into your profile SSH Keys in GitHub, Bitbucket, etc

Git Extensions - SSH Key Generation

查看更多
\"骚年 ilove
5楼-- · 2020-06-09 07:54

GitExtension ask to load private key only if you use Putty. You should do it manually for OpenSSH like described for GitHub https://help.github.com/articles/generating-ssh-keys

查看更多
登录 后发表回答