TortoiseGit使用不正确的SSH密钥 [英] TortoiseGit using incorrect SSH key

查看:767
本文介绍了TortoiseGit使用不正确的SSH密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在有一个奇怪的问题,那就是我无法弄清楚。尝试在github上提交到我的存储库时,出现错误


错误:授权给martindevans / Hermes.git拒绝key2


Key2是我用来访问不同的github版本库的一个密钥,但是远程url没有设置为使用key2,正如你在这里看到的那样设置为使用private.ppk



我是否做了明显错误的事情,还是乌龟git坏了?

铌。回应评论。使用普通的git结果:

  C:\ Users \Martin\Documents\Visual Studio 2010\Projects\\ \\ Hermes> git push 
权限被拒绝(publickey)。
fatal:远程终端意外挂起


解决方案

有不同的私钥格式。我的密钥对是用puttygen生成的,但我的Tortoise被配置为使用ssh.exe(形式为msysgit)作为ssh-client。所以我把它改成了plink(来自Tortoise),它工作。
$ b $ ul

  • ssh-key.exe => ssh.exe(C:\\ \\ msysgit\msysgit\bin)

  • puttygen.exe => TortoisePlink.exe(C:\ Program Files \TortoiseGit\bin)



  • 其他注意事项:请使用正确的网址! Github为您提供三个URL https,git和ssh。






    编辑:

    我在这里调整了设置

     设置 -  TortoiseGit>>网络>> SSH客户端
    C:\程序文件\TortoiseGit\bin\TortoisePLink.exe

    我已经生成密钥对

      C:\程序文件\\TortoiseGit\bin\puttygen.exe 


    I have a strange problem with tortoise git at the moment, which I can't figure out. When trying to commit to my repository on github I get the error

    ERROR: Permission to martindevans/Hermes.git denied to key2

    Key2 is a key I use to access a different github repository, however the remote url is not set to use key2, as you can see here it's set to use private.ppk

    Am I doing something obviously wrong, or is tortoise git broken?

    Nb. In response to the comments. Using normal git results in:

    C:\Users\Martin\Documents\Visual Studio 2010\Projects\Hermes>git push
    Permission denied (publickey).
    fatal: The remote end hung up unexpectedly
    

    解决方案

    There are different private key formats. My keypair was generated with puttygen, but my Tortoise was configured to use ssh.exe (form msysgit) as ssh-client. So i changed it to plink (from Tortoise) and it worked.

    • ssh-key.exe => ssh.exe (C:\msysgit\msysgit\bin)
    • puttygen.exe => TortoisePlink.exe (C:\Program Files\TortoiseGit\bin)

    Additional note: Use the correct URL! Github offers you three URL https, git and ssh.


    Edit:

    I adapted the settings here:

    Settings - TortoiseGit >> Network >> SSH-Client
    C:\Program Files\TortoiseGit\bin\TortoisePLink.exe
    

    I have generated the key-pair with:

     C:\Program Files\TortoiseGit\bin\puttygen.exe
    

    这篇关于TortoiseGit使用不正确的SSH密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆