2
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 "myname@mymachine.local"
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 git@github.com: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?
Add the key in your personal settings (the menu with your profile picture in the upper right), not in the repository settings. If it is in your personal settings you can use it for all your repositories – Gerald Schneider – 2019-05-08T11:27:14.227
@GeraldSchneider I think this isnt Ideal since any developer accessing to the legacy server via dev-user will be able to pull push via my github account. Is it? – koalaok – 2019-05-08T11:34:06.690
True. Then you will need different deploy keys. But I don't understand what you are asking in this case ... the first thing
ssh-keygen
asks you when you start it is the filename where it should store the key. – Gerald Schneider – 2019-05-08T11:41:04.497Ok. But I'm not sure If having multiple id_rsa_name.pub in my server .ssh dir might affect some previous configuration based on the default id_rsa.pub All the public key defined there will be active and equally available? Is the some circumstance that creating a new .pub file might create some issue? – koalaok – 2019-05-08T12:51:14.167