简体   繁体   中英

Ubuntu LAMP Git clone Permission denied (publickey)

I have set up a LAMP application on my droplet

I have used my set DO ssh key which is the same used for my mac and my bitbucket account.

I install git and create a folder at the /var/www level.

CD into the folder and run my git clone command but get the following error

Warning: Permanently added the RSA host key for IP address '131.103.20.167' to the list of known hosts. 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? 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.

Hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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