Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Pageant中的多个SSH密钥导致从Bitbucket Git Repos中提取时失败_Git_Bitbucket_Putty_Ssh Keys_Pageant - Fatal编程技术网

Pageant中的多个SSH密钥导致从Bitbucket Git Repos中提取时失败

Pageant中的多个SSH密钥导致从Bitbucket Git Repos中提取时失败,git,bitbucket,putty,ssh-keys,pageant,Git,Bitbucket,Putty,Ssh Keys,Pageant,我遇到了一个与上面描述的问题非常相似的问题。但是,不同之处在于,我尝试使用Pageant作为代理,而不是OpenSSH。我发现,当我在Pageant中加载了两个不同Bitbucket帐户的SSH密钥时,两个REPO中的一个将始终运行Git命令,而另一个将失败。工作的repo取决于在Pageant密钥列表中首先排序的SSH密钥 “fail”是指从Git命令返回以下错误: git -c diff.mnemonicprefix=false -c core.quotepath=false --no-op

我遇到了一个与上面描述的问题非常相似的问题。但是,不同之处在于,我尝试使用Pageant作为代理,而不是OpenSSH。我发现,当我在Pageant中加载了两个不同Bitbucket帐户的SSH密钥时,两个REPO中的一个将始终运行Git命令,而另一个将失败。工作的repo取决于在Pageant密钥列表中首先排序的SSH密钥

“fail”是指从Git命令返回以下错误:

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks fetch origin
Forbidden
fatal: Could not read from remote repository.

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

Completed with errors, see above.
我不知道这是PuTTY/选美、SourceTree还是Bitbucket问题。我怀疑这是一个Bitbucket问题,因为我发现如果我从Bitbucket帐户a中删除密钥a,然后尝试在存储库B上获取,那么即使在Pageant中加载了密钥a和密钥B,该命令也会成功。换句话说,当密钥未附加到任何Bitbucket帐户时,Bitbucket似乎没有问题


有人让Pageant同时加载多个Bitbucket回购的密钥吗?

我假设Bitbucket在引擎盖下使用PuTTY
plink
。使用
plink
,如果您使用
-i
开关指定密钥,并且密钥加载到Pagent,则
plink
将尝试仅使用该特定密钥进行身份验证(不会尝试加载到Pagent的其他密钥),并且不会提示输入密码短语。这相当于您链接的问题中OpenSSH的
~/.ssh/config
解决方案。但我不知道Bitbucket是否允许您自定义
plink
。我假设Bitbucket在引擎盖下使用PuTTY
plink
。使用
plink
,如果您使用
-i
开关指定密钥,并且密钥加载到Pagent,则
plink
将尝试仅使用该特定密钥进行身份验证(不会尝试加载到Pagent的其他密钥),并且不会提示输入密码短语。这相当于您链接的问题中OpenSSH的
~/.ssh/config
解决方案。但我不知道Bitbucket是否允许您自定义
plink