TortoiseGit is OK but GitExtensions fails

用户在使用GitExtensions时遇到权限被拒绝的问题,而TortoiseGit则可以正常工作。问题源于缺少SSH密钥文件。通过将TortoiseGit使用的RSA密钥转换为OpenSSH格式,并将其设置为~/.ssh/id_rsa,成功解决了GitExtensions的授权问题。
摘要由CSDN通过智能技术生成

TortoiseGit is OK but GitExtensions fails

GitExtensions and Git fail:

"git" pull --progress "origin"
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

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

Press Enter or Esc to exit...

But TortoiseGit is OK.

git.exe pull --progress -v --no-rebase "origin"
From github.com:jinq0123/recastnavigation
= [up to date]      master      -> origin/master
= [up to date]      release-2.0 -> origin/release-2.0
Already up to date.

ssh -T shows that the reason is there is no id files:

PS d:\github> ssh -vT git@github.com
OpenSSH_for_Windows
debug1: Connecting to github.com [20.205.243.166] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\jinqing/.ssh/id_rsa type -1
debug1: identity file C:\\Users\\jinqing/.ssh/id_xmss-cert type -1
debug1: Authenticating to github.com:22 as 'git'
debug1: Host 'github.com' is known and matches the ED25519 host key.
debug1: Found key in C:\\Users\\jinqing/.ssh/known_hosts:2
debug1: Will attempt key: C:\\Users\\jinqing/.ssh/id_rsa
debug1: Will attempt key: C:\\Users\\jinqing/.ssh/id_xmss
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: C:\\Users\\jinqing/.ssh/id_rsa
debug1: Trying private key: C:\\Users\\jinqing/.ssh/id_xmss
debug1: No more authentication methods to try.
git@github.com: Permission denied (publickey).
PS d:\github>

Copy my RSA key file rsa.ppk that TortoiseGit uses as ~/.ssh/id_rsa:

PS D:\jinqing\github_jinq\recastnavigation> ssh -T git@github.com
Load key "C:\\Users\\jinqing/.ssh/id_rsa": invalid format
git@github.com: Permission denied (publickey).
PS D:\jinqing\github_jinq\recastnavigation>

Open TortoiseGit/bin/puttygen.exe, load rsa.ppk, then Convensionis->Export OpenSSH key as ~/.ssh/id_rsa:

PS D:\jinqing\github_jinq\recastnavigation> ssh -T git@github.com
Hi jinq0123! You've successfully authenticated, ...

id_rsa begins with:

-----BEGIN RSA PRIVATE KEY-----
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值