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

Operating System & Version
Linux
cPanel & WHM Version
78.0 (build 49)

2Flow2

Registered
May 21, 2020
3
0
1
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!
 

cPSamuel

Well-Known Member
Staff member
Nov 20, 2019
71
13
83
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

Registered
May 21, 2020
3
0
1
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
 

cPSamuel

Well-Known Member
Staff member
Nov 20, 2019
71
13
83
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

Registered
May 21, 2020
3
0
1
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