简体   繁体   English

Ubuntu LAMP Git克隆权限被拒绝(公钥)

[英]Ubuntu LAMP Git clone Permission denied (publickey)

I have set up a LAMP application on my droplet 我已经在我的液滴上设置了LAMP应用程序

I have used my set DO ssh key which is the same used for my mac and my bitbucket account. 我已经使用了我设置的DO ssh密钥,该密钥与我的mac和我的bitbucket帐户使用的密钥相同。

I install git and create a folder at the /var/www level. 我安装git并在/ var / www级别创建一个文件夹。

CD into the folder and run my git clone command but get the following error CD进入文件夹并运行我的git clone命令,但出现以下错误

Warning: Permanently added the RSA host key for IP address '131.103.20.167' to the list of known hosts. 警告:将IP地址“ 131.103.20.167”的RSA主机密钥永久添加到已知主机列表中。 Permission denied (publickey). 权限被拒绝(公钥)。 fatal: Could not read from remote repository. 致命:无法从远程存储库读取。

Please make sure you have the correct access rights and the repository exists. 请确保您具有正确的访问权限,并且存储库存在。

Any ideas how to fix this? 任何想法如何解决这一问题?

This sounds like your key hasn't been added to your key chain. 听起来您的钥匙尚未添加到钥匙串中。 Are you running git on your DO server or your mac? 您是否在DO服务器或Mac上运行git? Either way run the following command: 无论哪种方式,请运行以下命令:

ssh-add {path to ssh key}

and then try and clone again. 然后尝试再次克隆。 Typically your ssh keys will be stored ~/.ssh but maybe somewhere else depending on your configuration. 通常,您的ssh密钥将存储为〜/ .ssh,但也可能存储在其他位置,具体取决于您的配置。

Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM