ako*_*ian 3 git ssh bitbucket amazon-ec2
我无法使用部署密钥将我的存储库克隆到远程EC2 ubuntu实例.以下是我遵循的步骤.
~/.ssh/know_hosts按照/sf/answers/1856447701/进行了清理这是输出 ssh -T git@bitbucket.org
You can use git or hg to connect to Bitbucket. Shell access is disabled.
This deploy key has read access to the following repositories:
username/repository: KEYNAME -- email@gmail.com
但是当我尝试克隆存储库时,
sudo git clone git@bitbucket.org:username/repository.git我收到以下错误
Cloning into 'repository'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我在这里错过了什么吗?有人有什么建议吗?
谢谢阅读.
这是令人尴尬的,这里的问题是我以sudo用户身份运行命令.
sudo git clone git@bitbucket.org:username/repository.git
Run Code Online (Sandbox Code Playgroud)
这可能是试图以root用户身份克隆存储库并导致错误.但是,克隆为当前用户,并为所需目录提供写入权限,这样我就可以成功克隆存储库.
此外,在此过程中,我的ssh键似乎已重置,因此请确保ssh -T git@bitbucket.org按预期工作.如果没有,跑步
# start the ssh-agent in the background
eval "$(ssh-agent -s)"
# Agent pid 59566
ssh-add ~/.ssh/id_rsa
Run Code Online (Sandbox Code Playgroud)
为我工作.更多细节
| 归档时间: |
|
| 查看次数: |
2478 次 |
| 最近记录: |