buy
Guide to Git – Set Up Access to Private Repositories

Overview

This document describes how to set up SSH access so you can clone a local Webuzo repository to a remote private repository. You must generate and copy SSH keys to the remote repository server before you can clone a local repository to the remote server.

This tutorial uses GitHub as an example host for a private repository. However, most of the steps in this tutorial are similar to the steps for any other private repository host.

Set up SSH access to private repositories

To set up access to private repositories, follow these steps

  • Open Terminal

Click on Terminal from End User Panel > Server Utilities > Terminal.
If Terminal option is not there then you need request Webuzo Admin to allow Shell access.
Once you’ve successfully connected to the terminal, continue following this guide.

  • Generate SSH key

Run the following command to create a SSH key :

ssh-keygen -t rsa -f ~/.ssh/repo -b 4096 -C "username@example.com"

Note : Replace repo with the name of the remote repository, username with your Webuzo username, and example.com with your Webuzo domain name.

For example, if your repository name is testrepo, your Webuzo username is soft, and your Webuzo domain name is webuzotest.com   then command should be :

ssh-keygen -t rsa -f ~/.ssh/testrepo -b 4096 -C "soft@webuzotest.com"

This command contains several parts. If you change anything in the command it can affect the performance of SSH key.

1) The -t flag indicates the type of algorithm for your SSH key.
2) The -f flag indicates the name for your public and private keys. With the -f flag, there is no need to specify the public key name as it will always be the same name as the private key, but with .pub as the suffix.
3) The -b flag indicates the size of the SSH key in bits.
4) The -C flag indicates a comment to add to your public key. This is helpful when identifying which public keys you have authorized in a remote system

Once you run this command, the system will prompt you to enter a passphrase so you do not enter a passphrase, and press Enter to continue.

  • Open SSH Access wizard

From End User panel navigate to Security > SSH Access.

Here you will see the key generated from terminal. Please refer following image.


From this wizard you need to Authorize  the key first.
After that copy the .pub key to add in Remote Host like GitHub.

  • Register SSH key with Host of your private repository

For example you are using GitHub, Please perform following steps :

1. Log in to your GitHub account.
2. Navigate to your private repository.
3. In the top right corner of the page, click Settings. A new page will appear.
4. In the left side click on Deploy keys menu. A new page will appear.
5. In the top right corner of the page, click Add deploy key.
6. In the Title text box, enter a custome name for the key.
7. In the Key text box, please paste the public SSH key from SSH Access page that you have created in previous step.
8. If you want to push code from Webuzo account to GitHub account you can select Allow write access checkbox.
9. Click Add Key

Once you successfully added the key in GitHub account you can directly use the Git TM Version Control feature to clone the same Private repository from GitHub.

    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list