<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How To Clone A Private Github Repo To A cPanel Server]]></title><description><![CDATA[<p dir="auto">To clone a privately-hosted remote repository to your cPanel server, you need to ensure that your hosting package has SSH enabled. However, customers on Web Hosting Magic need not worry as every hosting package comes with SSH access. Additionally, you must perform some extra steps for successful cloning.<br />
You have various options for accessing the command line interface. You can use cPanel's Terminal interface, which is located at cPanel &gt;&gt; Home &gt;&gt; Advanced &gt;&gt; Terminal. Alternatively, you can use any tool that allows you to access the cPanel server via SSH, or your local system's Terminal.</p>
<p dir="auto"><strong>Step 1: Generate An SSH Key</strong></p>
<p dir="auto">To begin, we need to generate an SSH key for authorization. Previously, we could use RSA keys with SHA-1. However, according to Github's security blog, RSA keys with SHA-1 are no longer accepted due to security concerns. To create a new SSH key with ECDSA encryption and add it to Github, use the following command.</p>
<pre><code>ssh-keygen -t ecdsa -b 521 -C your_email@example.com
</code></pre>
<p dir="auto">In the given scenario, the term "username" refers to the cPanel account username, while "example" denotes the domain name. When you execute this command, the system will ask you to provide a passphrase. It is important to note that you should not enter any passphrase. Press Enter to continue.</p>
<p dir="auto"><img src="https://lankadevelopers.s3.amazonaws.com/911c42c6-f229-4cd9-9b42-791dbf6cf7b6.png" alt="image1.png" class=" img-responsive img-markdown" /></p>
<p dir="auto"><strong>Step 2. Verify  Generated The SSH Key</strong></p>
<p dir="auto">You can verify the existence and correct location of the key by running the following command:</p>
<pre><code>cat ~/.ssh/id_rsa.pub
</code></pre>
<p dir="auto"><strong>Step 3. Register Your SSH Key With The Private Repository Host</strong></p>
<p dir="auto">If you need help registering your SSH key with a private repository host such as Bitbucket or GitLab, you can refer to their respective websites or documentation.</p>
<p dir="auto">Note that some repository hosts, like Bitbucket, may not allow you to configure write access for your access keys.</p>
<p dir="auto">To register your SSH key with GitHub, follow these steps:</p>
<ol>
<li>Sign in to your GitHub account.</li>
<li>Go to your private repository.</li>
<li>Click on "Settings" in the top right corner of the page to access a new page.</li>
<li>In the left-hand side menu, select "Deploy keys" to access a new page.</li>
<li>Click "Add deploy key" in the top right corner of the page to access a new page.</li>
<li>Enter the following details for your SSH key:<br />
•	In the "Title" text box, give your key a display name.<br />
•	In the "Key" text box, paste your entire SSH key. If you want to be able to push code from your cPanel account to your GitHub account, select the "Allow write access" checkbox. It is important to note that if you do not select this checkbox, you will only be able to deploy changes from your GitHub repository to the cPanel-hosted repository.</li>
<li>Click "Add key".</li>
<li>In the "Key" text box, paste the entire SSH key. If you want to push code from your cPanel account to your GitHub account, select the "Allow write access" checkbox. Do note that if you do not select this checkbox, you can only deploy changes from your GitHub repository to the cPanel-hosted repository.</li>
<li>Click "Add key" to complete the process.</li>
</ol>
<p dir="auto"><img src="https://lankadevelopers.s3.amazonaws.com/f267f764-ff89-41bf-b1cd-32a5eb36593d.png" alt="Screenshot 2023-04-19 142152.png" class=" img-responsive img-markdown" /></p>
<p dir="auto"><strong>Step 4 : Test Out The SSH Key</strong></p>
<p dir="auto">To check if your SSH key is working properly, execute the following command:</p>
<pre><code>ssh -T git@example.com
</code></pre>
<p dir="auto">In the above command, "<a href="http://example.com" target="_blank" rel="noopener noreferrer nofollow ugc">example.com</a>" refers to the host of your private repository, such as "<a href="mailto:git@github.com" target="_blank" rel="noopener noreferrer nofollow ugc">git@github.com</a>".</p>
<p dir="auto"><strong>Step 5: Clone The Private Repo</strong></p>
<p dir="auto">To clone the private repository onto your cPanel account, use the following command:</p>
<pre><code>git clone git@example.com:$name/private-repo.git
</code></pre>
<p dir="auto">Note that "<a href="mailto:git@example.com" target="_blank" rel="noopener noreferrer nofollow ugc">git@example.com</a>:$name/private-repo.git" is the clone URL for the private repository.</p>
<p dir="auto">If you encounter the error message "Error: The WebSocket handshake failed at..." while accessing cPanel's Terminal interface (cPanel &gt;&gt; Home &gt;&gt; Advanced &gt;&gt; Terminal), double-check your connection.</p>
<p dir="auto">If you are currently using a VPN, disconnect from it and use your regular internet connection instead.</p>
]]></description><link>https://lankadevelopers.lk/topic/972/how-to-clone-a-private-github-repo-to-a-cpanel-server</link><generator>RSS for Node</generator><lastBuildDate>Tue, 16 Jun 2026 00:13:10 GMT</lastBuildDate><atom:link href="https://lankadevelopers.lk/topic/972.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 19 Apr 2023 08:54:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How To Clone A Private Github Repo To A cPanel Server on Wed, 19 Apr 2023 12:36:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://lankadevelopers.lk/uid/27">@root</a> Should be work if you have SSH access.</p>
]]></description><link>https://lankadevelopers.lk/post/4878</link><guid isPermaLink="true">https://lankadevelopers.lk/post/4878</guid><dc:creator><![CDATA[rohandhananjaya]]></dc:creator><pubDate>Wed, 19 Apr 2023 12:36:49 GMT</pubDate></item><item><title><![CDATA[Reply to How To Clone A Private Github Repo To A cPanel Server on Wed, 19 Apr 2023 09:45:27 GMT]]></title><description><![CDATA[<p dir="auto">is this can apply to the plesk ?</p>
]]></description><link>https://lankadevelopers.lk/post/4874</link><guid isPermaLink="true">https://lankadevelopers.lk/post/4874</guid><dc:creator><![CDATA[root]]></dc:creator><pubDate>Wed, 19 Apr 2023 09:45:27 GMT</pubDate></item></channel></rss>