I have this legacy server with CentOS release 6.6 (Final), w/ git version git version 1.7.1
I need to pull on it different Github projects. Access to server is shared by multiple persons via a common auth system.
Taken into account that the above env cannot be changed or upgraded.
I have the following issue. I have already connected successfully to a git repo and deal with it by defining a Deploykey, the unique I have actually defined in:
/home/dev-user/.ssh/id_rsa.pub
Now I've tried to add the same deploy key to manage a different github repo. But github 's giving me an error , key is already in use.
So I'm thinking to create multiple id_rsa_reponame.pub ssh keys to pull (mainly) my github repo to this server.
Can this be considered a best practice in this case? Id yes...How can I create different named public keys to use as deploy key on github repo?
Any other way to solve this is welcome.
Thanks
UPDATE
I've tested the following from another development machine. In this machine I already had a
/home/username/id_rsa.pub
Already defined as deploy key on a github repo and working correctly.
Then I issued the command:
ssh-keygen -t rsa -b 4096 -C "[email protected]"
When prompted I gave a different name to the key like:
/home/username/id_rsa_mytest.pub
Then I copied the content of this file and set as deploy key for another repo.
I tried to git clone:
git clone [email protected]:githubAccount/myrepo.it
But got:
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
I believe that local machine is not trying automatically all my pub keys to connect to github via ssh.
How can I achieve that?
ssh-keygen
asks you when you start it is the filename where it should store the key.