Atlassian/BitBucket Sourcetree SSH公钥被拒绝 [英] Atlassian / BitBucket Sourcetree SSH Public Key Denied
问题描述
我正在 https://www.bitbucket.com 上的私有存储库中的项目上工作.
I'm working on a project in a private repository on https://www.bitbucket.com.
我正在对其进行本地编码,然后通过BitBucket/Atlassian的Windows Git客户端 Sourcetree .
I'm coding it locally, then staging, commiting and pushing the update via BitBucket's / Atlassian's Windows Git client, Sourcetree.
然后,我从需要SSH身份验证的远程共享服务器中提取文件.
After that, I'm pulling the files from a remote shared server, which requires SSH authentication.
为了将git repo与BitBucket帐户连接,我尝试了以下操作:
I've tried the following in order to connect the git repo with the BitBucket account:
- 启动了嵌入式Sourcetree SSH代理(Pageant)
- 使用我的密码将我的
.ppk
(PuTTY私钥)添加到Pageant中 - 在项目所在的位置打开SourceTree Terminal,我们将其称为
C:/Project
. - 使用
git init
初始化存储库. - 使用
git push -u origin --all
可以将存储库从我的计算机推送到BitBucket. - 收到此错误:
Permission denied (publickey).
- 试图查看我是否可以通过执行
ssh -Tv git@bitbucket.org
来获得更多详细输出-仍然是Permission denied
.
- Launched the embedded Sourcetree SSH agent (Pageant)
- Added my
.ppk
(PuTTY Private Key) to Pageant using my passphrase - Opened the SourceTree Terminal in the location of my project, let's call it
C:/Project
. - Used
git init
to initialize the repository. - Used
git push -u origin --all
in order to push the repo from my computer to BitBucket. - Got this error:
Permission denied (publickey).
- Tried to see if I can get some more verbose output by doing
ssh -Tv git@bitbucket.org
- Still,Permission denied
.
我正试图弄清楚到底出了什么问题-Sourcetee根本找不到我的SSH密钥吗?密钥是否未装入某些特定位置,从而导致此现象?
I'm trying to figure out what exactly went wrong - did Sourcetee find my SSH key at all? Is the key not loaded in some specific place, causing this behavior?
注意:我已将公共密钥加载到BitBucket上的个人资料中.
Note: I have loaded the public key in my profile on BitBucket.
推荐答案
嗯-经过反复尝试,我找到了解决方案.
显然,使用PUTTY的密钥生成器并将新的公共密钥存储在我的.ssh
文件夹中是行不通的.
但是,使用ssh-keygen
IN GIT BASH ,然后尝试使用新生成的密钥对登录,效果很好.
出于好奇,尽管比什么都重要-我很想知道为什么会这样.
Well - I've found the solution after much trial and error.
Apparently, using PUTTY's keygen and storing the new public key in my .ssh
folder doesn't work.
However, using ssh-keygen
IN GIT BASH and then trying to login using the new generated key pair, works just fine.
Out of curiosity though more than anything - I would love to know why this is the case.
这篇关于Atlassian/BitBucket Sourcetree SSH公钥被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!