Cloning private GitHub projects onto a new worker Linux box.
Goals:
That machine should have access to that project, but not other projects. This is done using the Deploy Keys feature of GitHub.
It should be able to access other repositories as needed. Note that each repository will need its own SSH key.
Implementation, for each project and machine:
Generate a new ssh key for that project, and add it to the repository’s list of allowed deploy keys.
ssh-keygen -f project1 -C project1Set up ssh config
Host project1.gh HostName github.com IdentityFile /path/to/your/keys/project1 User gitUse
project1.ghinstead ofgit@github.comwhen cloning the repository.
I do this when I set up my notes vault on a new machine.