Black Friday Hosting Deals: 69% Off + Free Migration: Grab the Deal Grab It Now!
If you are encountering the Git Error Code 128: Generating 'Access Denied' if you fail to push or pull repositories with cPanel hosting Git repository is usually caused by the permissions problem either in the Git repository or the user account attempting to access the Git repository. This cannot be funny, but some solutions exist to fix the error.
The error number 128 calls an error code that many programs return on Unix-based systems like cPanel because there was an issue with access permission. This sort of permission issue mainly occurs with Git when you are not using the user account you are supposed to use that does not have enough privileges to read the Git repositories.
There are a few common reasons this error can occur in cPanel:
Incorrect Repository URL: Your script may be using the wrong Git repository URL, which could be why you are experiencing the problem.
SSH Key Issues: The SSH key you have defined on your local environment could differ from the authorized vital that you have on the server.
Repository Ownership: The ownership and permissions on the Git repository itself may not be set correctly in cPanel.
SELinux Issues: If SELinux is enabled and misconfigured, it could block Git operations due to incorrect security policies.
Here is an outline of how you can figure out and even fix error '128' in cPanel:
Verify Repository URL: Verify that the repository URL provided as the origin is the one you want to connect to Git regrep. The URL should be in the format ssh:`//[email protected]/path/to/repo.git`.
Check SSH Key: Confirm that the SSH key you have set in your local universe matches the Public Key listed in the SSH Access section of the cPanel interface. Alternatively, make the key importable or available through the terminal as well.
Check Repository Ownership: Log in to your server over SSH and navigate to the Git repository folder (e.g.,/home/username/repo. Git). Use ls -al to check the ownership. If you don't own the folder, use chown to transfer ownership to your cPanel username.
Set Repository Permissions: Use ls -al to check the permissions on the Git repository folder. The folder and its contents must have permissions set to 0755 or 0700. Use chmod to set the desired permissions recursively.
Disable SELinux: SELinux can sometimes interfere with Git operations. Try temporarily turning it off to see if that resolves the issue:
codesudo setenforce 0
If disabling SELinux works, you must adjust the SELinux policies to allow the needed Git operations properly.
Restart Git Server: Once any appropriate changes or corrections have been made to ownership, permissions, or SELinux, restart the Git server process in cPanel to enable the changes.
Open Support Ticket: Once you've tried all the above steps and the problem persists, you can open a support ticket with your hosting service provider and get their support.
Make sure you are running the latest version of Git locally and that your cPanel server also has the latest Git version installed.
Check the Git logs on your cPanel server (usually /var/log/Git) for any additional error messages that could provide more context.
Try creating a new test repository to isolate if the issue is specific to a single repo or a broader configuration problem.
If using Git over HTTPS, ensure you have followed the correct public critical setup process rather than using SSH URLs.
By methodically checking repository URLs, SSH keys, repository permissions, and server configurations, you should be able to pinpoint and resolve the root cause of the Error Code 128 'Permission Denied' issue with Git on your cPanel server.
Let’s talk about the future, and make it happen!
By continuing to use and navigate this website, you are agreeing to the use of cookies.
Find out more