Home > Back-end >  Setup multiple private repositories cpanel
Setup multiple private repositories cpanel

Time:01-16

How can I setup access for multiple private repositories in Cpanel?

I've tried many tutorials and documentation. Here is one of them: enter image description here

  • 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.

    1. Git Version Control > Create > Enter the details: enter image description here

    But when I always got this error: enter image description here

    Am I missing something?

    EDIT 2:

    I've tried different Clone URL and it gives this error: enter image description here

    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 and testing2, and both your cPanel and GitHub usernames are cptest, 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 of IdentityFile=...)
    • 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)

    • Related