How can I setup access for multiple private repositories in Cpanel?
I've tried many tutorials and documentation. Here is one of them:
Test the SSH keys by doing this in the terminal:
ssh -i ~/.ssh/top25restaurants -T [email protected]
ssh -i ~/.ssh/top25restaurants -T [email protected]
Both return this message: Hi <username/repo_name>! You've successfully authenticated, but GitHub does not provide shell access.
But when I always got this error:
Am I missing something?
EDIT 2:
I've tried different Clone URL and it gives this error:
CodePudding user response:
So is it possible to create an ssh key without a default name? Also, how to create multiple private repos in Cpanel?
That is what the documentation you are referring to mentions.
Set up access to multiple repositories
To create an SSH key for each of your repositories, follow the steps outlined above.
After you have added the keys to the remote repositories, create a local~/.ssh/config
file to alias each of the keys to their corresponding repository names.For example, if you have two repos configured on GitHub,
testing
andtesting2
, and both your cPanel and GitHub usernames arecptest
, create or modify the~/.ssh/config
file with these contents:Host testing.github.com Hostname github.com IdentityFile /home/cptest/.ssh/testing User git Host testing2.github.com Hostname github.com IdentityFile /home/cptest/.ssh/testing2 User git
Compared to their documentation, I would use:
IdentityFile /home/cptest/...
(instead ofIdentityFile=...
)User git
- a FQDN-like Host entry:
xxx.yyy.com
That way, the URL becomes: git clone testing.github.com:me/myRepo
If the cPanel requires a valid protocol, use:
ssh://github.com-testing/me/myRepo
^^^^^^ ^^^
(valid protocol) (/, not :)
In your case:
ssh://top25vineyards.github.com/me/myRepo
ssh://top25vineyards.github.com/Penk13/top25vineyards
(to mimic an fully-qualified domain name)