作曲者权限被拒绝(公钥) [英] Composer permission denied (publickey)

查看:64
本文介绍了作曲者权限被拒绝(公钥)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在BitBucket上有一个私人仓库,我试图使用composer install在localhost上安装,这是我的composer.json文件:

I Have a private repo on BitBucket, Im trying to install on localhost using composer install, here is my composer.json file:

{
"repositories": [
    {
        "type": "git",
        "url":  "git@bitbucket.org:username/repo.git"
    }
]
}

从命令行运行composer install时,我得到:

When I run composer install from the command line I get:

[RuntimeException] 无法执行git clone --mirror"git@bitbucket.org:username/repo.git""C:/Users/...../" 克隆到裸存储库'C:/Users/.....'... 权限被拒绝(公钥). 致命:无法从远程存储库读取. 请确保您具有正确的访问权限 并且存储库存在.

[RuntimeException] Failed to execute git clone --mirror "git@bitbucket.org:username/repo.git" "C:/Users/...../" Cloning into bare repository 'C:/Users/.....'... Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

我的密钥对有一个密码短语,但作曲家从未要求过它,我正在运行Windows 10,同时运行了Pageant客户端并选择了正确的密钥.

My key pair has an passphrase but composer never asks for it, I am running windows 10 with the Pageant client running and the correct key selected.

还有一个配置文件,其中包含以下数据:

Also there is a config file with this data:

Host bitbucket.org
IdentityFile ~/.ssh/openssh (yes my key name is openssh)

有趣的是,如果我复制并粘贴以下命令:

The funny thing is that if I copy and paste this command:

git clone --mirror"git@bitbucket.org:username/repo.git"

git clone --mirror "git@bitbucket.org:username/repo.git"

我确实要求我输入密码,然后它开始克隆存储库.

I do get ask for my passphrase and after that it start cloning the Repo.

可能是什么问题?有关此错误的大多数信息都直接针对git命令,但就我而言,它们起作用了,作曲家不起作用了,我在做什么错了?

What could be wrong? most information about this error refers directly for git commands, but in my case they work, what is not working is composer, what am i doing wrong?

推荐答案

我遇到了同样的问题,这篇文章的回答对我有所帮助 为什么git无法在Windows下记住我的密码

I had the same problem and answer from this post helped me Why git can't remember my passphrase under Windows

我所做的就是在CMD中运行"start-ssh-agent"并提供密码.

All I did was to run 'start-ssh-agent' in CMD and provide password.

第三种解决方案采用Window,msysgit和本机命令提示符.

Third solution Assumes Window, msysgit, and native command prompt.

安装msysgit

确保允许在MS-DOS上使用git

Make sure to allow git to be used on the MS-DOS

命令提示符运行start-ssh-agent

command prompt Run start-ssh-agent

输入SSH密码

全部完成!吉特 命令现在应该可以在本机命令提示符下工作.

All done! Git commands should now work in the native command prompt.

这篇关于作曲者权限被拒绝(公钥)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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