# Clone private repo to the cPanel!

# <mark>Overall all commands are!</mark>

```bash
# Generate an RSA SSH key pair with 2048 bits and a comment
ssh-keygen -t rsa -b 2048 -C username@serverdomain

# Create an SSH configuration file if it doesn't exist
touch ~/.ssh/config

# Set the permissions of the SSH configuration file to 0600
chmod 0600 ~/.ssh/config

# Change ownership of the SSH configuration file to the username
chown username:username ~/.ssh/config

# Test the SSH connection to GitHub
ssh -T git@github.com
```

You can copy and paste these commands into your terminal to execute them.

## Step 1: Open the terminal from your cPanel

## Step 2: Type or copy this text

```bash
# Generate an RSA SSH key pair with 2048 bits and a comment
ssh-keygen -t rsa -b 2048 -C username@serverdomain
```

You can copy and paste these commands into your terminal to execute them.

<mark>Note: fill in the username and the server domain as shown in the given below:</mark>

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696572003183/792395f2-17ad-4cd0-8070-dec4a4c10008.png align="center")

## Step 3: Now press enter

<mark>note: there could be already so if you want to overwrite then type y and press enter</mark>

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696572056520/9d6ece95-57d1-4630-a096-450fb0ce88c2.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696572092137/425b56e1-d1da-4e89-a254-4bc0afa9a8a9.png align="center")

## Step 4: Now copy and paste or type given below command

```bash
# Create an SSH configuration file if it doesn't exist
touch ~/.ssh/config

# Set the permissions of the SSH configuration file to 0600
chmod 0600 ~/.ssh/config

# Change ownership of the SSH configuration file to the username
chown username:username ~/.ssh/config
```

You can copy and paste these commands into your terminal to execute them.

<mark>note: check in the username you have to put your username</mark>

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696572194507/7ec42331-8f7d-40df-8a04-7aa5d0007429.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696572315762/63f5f49e-488a-4b79-92b3-73227738b7f1.png align="center")

## Step 5: Now open <mark>SSH Access</mark> on your cPanel

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696572381241/8e15158a-4156-40ca-9dce-b47c0e62d678.png align="center")

## Step 6: Now open <mark>Manage SSH Keys</mark>

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696572437317/e9221c6e-a76a-4f1a-9b0d-6d6413860daa.png align="center")

## Step 7: Now open the <mark>View/Download </mark> Option

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696572516790/d4e9e766-723f-4282-b3d5-5dd2d6ee86ec.png align="center")

## Step 8: Now copy the ssh key or download it

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696572554544/5a0b84c7-3a8e-4ec7-8b09-c53cec4b330f.png align="center")

## Step 8: Now go to the GitHub repo and add deploy keys by below screenshots

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696572692932/c9c12dde-df22-4050-81d1-a06f83013e92.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696572812762/b931649a-dd57-4bee-8054-2c7ca22afda8.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696572843352/48791c58-8966-480a-8b52-6b5dd7b0d0f7.png align="center")

## Step 9: Now open the terminal again on your cPanel and paste the given below command and press enter

```bash
# Test the SSH connection to GitHub
ssh -T git@github.com
```

You can copy and paste these commands into your terminal to execute them.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696572932995/dc6338bd-18fd-4716-b7db-5a4ef6cc3b81.png align="center")

## Step 10: Now go to the Git version control on Cpanel

now, click on the create button. and copy the ssh link of the private repo from your GitHub

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696573112167/309635e7-8ce1-4395-a2e7-62ada2458174.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696573163536/66cf86b0-5f6c-429f-8bd1-62d1a1728ed2.png align="center")

## Step 11: Now, click on the create button, copy the SSH link of the private repo from your GitHub and paste it to the <mark>clone URL</mark> Option

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696573248713/7b502be7-17d9-4e49-b38f-c778f3e0314b.png align="center")

<mark>note: you could change the repository path and simply click on the create button if you want to update the changes go to the manage option and you can simply update and update from the remote, just as shown in the screenshot below</mark>

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696573343191/8e9c17be-87bb-43b7-b565-77f1f1d71e61.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696573438388/44603974-4a2a-460f-b3fe-265c950e33cf.png align="center")
