Creating a new Project from GitHub repository; need to be able to put in security keys

So here is the error, but I am not surprised.

>>> git clone --progress****************************** project
Cloning into 'project'...
Warning: Permanently added ',' (RSA) 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.**


so where do I stick my GitHub keys?


You add your ssh keys to your ssh-agent

This isn't really an R nor Rstudio question. The answer you're looking for is probably covered by this page about adding the keys to your agent which is part of a more comprehensive tutorial about using ssh to connect to github.

Where to store github keys? Wherever you store ssh keys.

On many systems keys are stored in ~/.ssh directory. Generally any location works so long as it's only readable by the user the keys belong to.

Configure ssh-agent to automatically add keys it finds.

In short, you put the keys somewhere ssh-agent picks them up automatically, or you add them manually.

Roll your own key adding

I use a bashrc to add they keys for a certain amount of time when I start a login terminal. My .bashrc contains the following:

if [[ `ssh-add -l` == *"mygitkey"* ]]; then 
echo 'github identity aldready added.'
  ssh-add -t 8h ~/.ssh/mygitkey

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.