How to clone a private Git repository without cPanel Terminal access?

2Flow2

Member
May 21, 2020
8
2
3
United States
cPanel Access Level
Website Owner
Hi there! I have created a small-ish web application that I want to host on my website. I've already got a well-established website that is being hosted through GoDaddy, this application will just be for my company's internal use in a hidden-away directory.

Anyway, I want to be able to keep persistent changes between the web application's files on my website and the ones I am working on that I push to my GitHub repository. I have tried following the steps in this video to connect my private GitHub repo to my website using cPanel's "Git™ Version Control" interface, but I ran into the error
Code:
Error: “/usr/local/cpanel/3rdparty/bin/git” reported error code “128” when it ended: fatal: could not read Username for 'https://github.com': No such device or address
I believe this is because my repository is private and not public.

So I tried following the steps in these guides to set up access to the private Git repository using an SSH key, but the tutorial requires access to cPanel's Terminal which I do not have access to on my website. I tried giving myself access to the Terminal using WHM (via some instructions I found) but I don't think I have access to WHM or the Terminal because of GoDaddy. I noticed that this post said
Now if what you require is the "Terminal" functionality (Attached screenshot) of WHM and you cannot find it, it is possible that your hosting provider has deactivated as indicated below.

Server administrators can create the touch file / var / cpanel / disable_whm_terminal_ui to disable the terminal application for WHM users. This includes resellers with root access and the root user. The system does not create this file by default.
I think that this may be the case for me, because I do not know how to log into WHM and I see no way to do it from my GoDaddy dashboard. (I was not the one who originally purchased and set up the server, this was done by someone else.)

So assuming that I am not able to turn on the Terminal for my cPanel account, how can I link a private Git repository? Thanks for any help!
 

SamuelM

Technical Analyst Team Lead
Nov 20, 2019
196
38
103
USA
cPanel Access Level
Root Administrator
Hello @2Flow2

Thank you for contacting cPanel!

It is indeed necessary to have SSH access in order to access a Git private repository. The "disable_whm_terminal_ui" touch file you referenced is specifically for disabling the embedded terminal emulator inside the WHM or cPanel interfaces. However, even if this is disabled in the interface, it may be possible to login via another standalone SSH client, for example Terminal.app on Mac OS or Putty on Windows. With that said, hosting providers also have the option to disable SSH access altogether for cPanel users.

I do not know exactly what policies Godaddy has for SSH access, and it's possible they vary depending upon the hosting package. I did find the following Godaddy documentation, though. This provides instructions for enabling SSH on a Godaddy hosting account:

https://www.godaddy.com/help/enable-ssh-for-my-linux-hosting-account-16102

I hope this helps. Please let us know if you have any questions.
 

2Flow2

Member
May 21, 2020
8
2
3
United States
cPanel Access Level
Website Owner
Hello @2Flow2

Thank you for contacting cPanel!

It is indeed necessary to have SSH access in order to access a Git private repository. The "disable_whm_terminal_ui" touch file you referenced is specifically for disabling the embedded terminal emulator inside the WHM or cPanel interfaces. However, even if this is disabled in the interface, it may be possible to login via another standalone SSH client, for example Terminal.app on Mac OS or Putty on Windows. With that said, hosting providers also have the option to disable SSH access altogether for cPanel users.

I do not know exactly what policies Godaddy has for SSH access, and it's possible they vary depending upon the hosting package. I did find the following Godaddy documentation, though. This provides instructions for enabling SSH on a Godaddy hosting account:

https://www.godaddy.com/help/enable-ssh-for-my-linux-hosting-account-16102

I hope this helps. Please let us know if you have any questions.
Ah, thank you @cPSamuel ! This seems to put me one step closer to where I need to be! The GoDaddy instructions that you linked worked for my account, and I was able to turn on SSH access. It provided me with the credentials for logging in (see screenshot below), but when I try to connect via PuTTY with my cPanel credentials, I just get the error "Access denied" (see second screenshot). I have ensured multiple times that the credentials are exactly right, and are identical to the ones being shown in GoDaddy's "SSH Setup" GUI.
Any ideas why this occurring? What should my next steps be to try and SSH into my cPanel account? Thanks!
1590191051366.png1590191504129.png
 

SamuelM

Technical Analyst Team Lead
Nov 20, 2019
196
38
103
USA
cPanel Access Level
Root Administrator
If you are using the exact same username and password that were provided in your Godaddy account and you receive the "Access denied" error message, then you likely need to contact Godaddy to ask why you receive the error message.

With root access, an administrator at Godaddy should be able to check the SSH access log. If you let them know the time you attempted to login, as well as the username you used and the IP address from which you are connecting, they should be able to easily identify the exact errors logged with these failed login attempts. You can find the IP address you are connecting from by visiting the following URL:

http://go.cpanel.net/myip

Feel free to let us know if you have any other questions!
 

2Flow2

Member
May 21, 2020
8
2
3
United States
cPanel Access Level
Website Owner
Alright, I contacted GoDaddy customer support and figured out that you have to use the cPanel username and password (seperate from the GoDaddy username and password) for the SSH to work correctly. After understanding that and successfully logging in, I was able to successfully clone my private repository into my web server using PuTTY! thanks for all your help @cPSamuel !

The one final thing I had a question about is that I noticed even though my site's directory contains a .git folder and can successfully clone from my private Git repository using SSH, the repository still does not show up in cPanel's "Git™ Version Control" interface. How do I set it set it so that the cPanel system detects there is a repository in my files? (I want to be able to easily manage my repository/site linkage, like pushing and pulling, from any computer later without having to use an SSH client.) Is it possible to have my Git repository show up in this list, even though it is private?
1590540701465.png
 

2Flow2

Member
May 21, 2020
8
2
3
United States
cPanel Access Level
Website Owner
Alright, I contacted GoDaddy customer support and figured out that you have to use the cPanel username and password (seperate from the GoDaddy username and password) for the SSH to work correctly. After understanding that and successfully logging in, I was able to successfully clone my private repository into my web server using PuTTY! thanks for all your help @cPSamuel !

The one final thing I had a question about is that I noticed even though my site's directory contains a .git folder and can successfully clone from my private Git repository using SSH, the repository still does not show up in cPanel's "Git™ Version Control" interface. How do I set it set it so that the cPanel system detects there is a repository in my files? (I want to be able to easily manage my repository/site linkage, like pushing and pulling, from any computer later without having to use an SSH client.) Is it possible to have my Git repository show up in this list, even though it is private?
View attachment 65789
Any word on this, @cPSamuel ? :)
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,273
1,282
313
Houston

2Flow2

Member
May 21, 2020
8
2
3
United States
cPanel Access Level
Website Owner
The repository as far as I am aware should show up unless it is in one of the directories listed here: Guide to Git™ - Host Git Repositories on a cPanel Account | cPanel & WHM Documentation

If you use the command line to create the repository in one of these restricted paths the interface will not display the repository
This is extremely odd. My path name does not seem to violate any of the stipulations laid out in that Documentation page. The full path to the .git/ folder is /home/myUsername/public_html/order. I can navigate to it in the Terminal and successfully run all the git commands from there (pull, push, etc.) but it doesn't show up in the "Git™ Version Control"? Any other ideas?
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,273
1,282
313
Houston
That is odd and maybe it's best if one of our analysts can view the configuration to assist you with it. Can you please open a ticket using the link in my signature? Once open please reply with the Ticket ID here so that we can update this thread with the resolution once the ticket is resolved.


Thanks!
 

2Flow2

Member
May 21, 2020
8
2
3
United States
cPanel Access Level
Website Owner
That is odd and maybe it's best if one of our analysts can view the configuration to assist you with it. Can you please open a ticket using the link in my signature? Once open please reply with the Ticket ID here so that we can update this thread with the resolution once the ticket is resolved.
Hi @cPanelLauren ! Sorry about the late response, but I had some issues when trying to create a cPanel support ticket. On the first support ticket page it asks for my "Support Access ID." The two ways it gives to find the Support Access ID are to log in to WHM or to log in to your server from a shell.
1595121488804.png
I tried logging into WHM for my server (by going to https://mydomain:2087), but it would not accept the credentials that I use for logging into cPanel. I called my hosting service (GoDaddy), and they said that I probably don't have WHM associated with my account because I am using "Shared hosting." So I am not able to log into WHM to obtain the Support Access ID.

I SSH'ed into my server to use the mentioned shell method, but running the command /usr/local/cpanel/cpanel -S just resulted in the output bash: /usr/local/cpanel/cpanel: No such file or directory. Also, /usr/local/cpanel/cpanel -S doesn't actually look like a valid command anyway? Is there a command named "cpanel" built-in? Should the hint mistakenly have said /usr/local/cpanel/etc? Either way, it is not helping me find the Support Access ID that I need.

What should I do to find my Support Access ID? Thanks!
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,273
1,282
313
Houston
I apologize, I didn't realize you did not have root access to the server. In order to look further into this your hosting provider would need to assist you in this case. There may be some configuration that is present on the server preventing your ability to utilize git properly.
 

2Flow2

Member
May 21, 2020
8
2
3
United States
cPanel Access Level
Website Owner
I apologize, I didn't realize you did not have root access to the server. In order to look further into this your hosting provider would need to assist you in this case. There may be some configuration that is present on the server preventing your ability to utilize git properly.
Oh, okay. So it may be some configuration by my hosting provider that is causing the cPanel interface to not recognize the git repository present? Because pushing/pulling is working correctly (when I do it manually from the shell), it just is not showing up in cPanel's "Git™ Version Control" interface.
Thank you!
 
  • Like
Reactions: cPanelLauren

bravonet

Registered
Oct 28, 2020
2
0
1
malaysia
cPanel Access Level
Root Administrator
Hi,

im new in this forum and im not able to create new topic, that's why im in here posting my question here. im facing difficulties in cloning private repo in cPanel. i've follow the instruction here Guide to Git™ - How to Set Up Deployment | cPanel & WHM Documentation but its still failed. below are the steps that i've done,

1. generate SSH key in my local machine. (because cPanel's SSH key generator doesn't allow me to generate key without password)
2. login to my cPanel account & go to SSH Access and import my key into cPanel.
3. change the public key authorization into authorized.
4. deploy public key into my github repo.
5. go to Git™ Version Control and insert the details require to clone my private repo.
Clone URL: [email protected]/username/repo_name.git (im sure that my username & repo_name is correct)
6. click on the create button.

outcome: Error:(XID 6xpzp3) “/usr/local/cpanel/3rdparty/bin/git” reported error code “128” when it ended: fatal: '[email protected]/username/repo_name.git' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

please help.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
10,360
1,629
363
cPanel Access Level
Root Administrator
Hey there! I searched for other users with this error in our system and in all the ones I found this was related to an issue with the key setup. Can you double-check the key access between GitHub and your server?

If that doesn't end up being the issue, troubleshooting Git over a forum can often be messy so this might be a good one to submit a support ticket to our team to have them take a look.