我将Amazon EC2实例用作开发服务器,并且尝试git将我的存储库从bitbucket克隆到Amazon EC2实例。我想做的是将钩子提交提交添加到bitbucket,以便所有提交到存储库的更改自动反映到我的开发服务器。
我将ssh槽连接到我的Amazon EC2实例,但是当我尝试git克隆存储库时,出现以下错误:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)
我找到了许多有关此问题的解决方案,但似乎都没有用!
到目前为止,这是我尝试过的:
创建的弹性ip并与我的实例关联
-修改了安全组以允许入站网络流量
-从亚马逊下载生成的Pem密钥,并使用puttygen生成私钥和公钥
-将公钥(id_rsa.pub)和pem密钥上载到我的.ssh文件夹,并将权限更改为600
-将公钥添加到bitbucket部署密钥中
-将公钥添加到亚马逊上的authorized_keys文件中
-在.ssh文件夹中创建了一个配置文件,并在其中添加了以下几行:
Host bitbucket.org
Hostname bitbucket.org
User ubuntu
IdentityFile ~/.ssh/amzon_key.pem
Run Code Online (Sandbox Code Playgroud)
-试图以root用户身份git克隆存储库
我在Windows上使用腻子。