Introduction

Error Code 128 in cPanel typically occurs when trying to create or clone a Git repository using the cPanel Git™ Version Control tool. The error message is as follows:

vbnet
 
“/usr/local/cpanel/3rdparty/bin/git” reported error code “128when it ended: Permission denied, please try again. Permission denied, please try again. Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

Why This Happens

This error arises when your remote Git repository rejects access due to incorrect or missing authentication credentials. The most common cause is an issue with SSH key authentication or using the wrong protocol to connect to the repository.


How to Fix Git Error Code 128

Step 1: Use SSH Protocol for the Repository URL

  • If you’re using an HTTPS URL or plain Git URL, replace it with the SSH URL.
    • SSH URLs typically start with ssh:// or git@ (e.g., [email protected]:username/repository.git).
  • SSH is required because cPanel's Terminal enforces authentication through SSH keys for security.

Step 2: Generate and Configure SSH Key

If you don’t already have an SSH key configured, follow these steps:

  1. Generate an SSH Key: Run the following command in cPanel's Terminal (accessible via cPanel >> Home >> Advanced >> Terminal):

    bash
     
    ssh-keygen -t rsa -b 4096 -C "[email protected]"
    • Replace "[email protected]" with your email address or username.
    • When prompted for a passphrase, press Enter to skip.
  2. Check if the SSH Key Exists: Verify the generated key with:

    bash
     
    cat ~/.ssh/id_rsa.pub

    If the output displays a valid SSH key (ssh-rsa AAAAB3Nza...), your key is correctly configured.


Step 3: Register the SSH Key with Your Git Provider

You need to add the public SSH key to your Git repository provider (e.g., GitHub, GitLab, Bitbucket). Here's how to do it on GitHub:

  1. Log in to your GitHub account.
  2. Navigate to Settings > SSH and GPG keys.
  3. Click New SSH key.
  4. Add a Title and paste the public SSH key from Step 2 into the Key field.
  5. Save the changes by clicking Add SSH Key.

For other Git providers, refer to their documentation on how to add SSH keys.


Step 4: Test SSH Key Authentication

To ensure the SSH key is working, test the connection with:

bash
 

If successful, you’ll see a message confirming authentication (e.g., "Hi username! You've successfully authenticated.").


Step 5: Clone the Repository

After setting up SSH access, clone the repository with:

bash
 
git clone [email protected]:username/repository.git

Replace username/repository.git with the actual repository URL.


Additional Notes

  • Ensure you have the correct access rights for the repository (read/write as required).
  • If you’re cloning a private repository, double-check the permissions and access tokens in your Git provider's settings.
  • You can refer to this detailed guide on setting up private repository access using Git.

By following these steps, you should be able to resolve Git Error Code 128 in cPanel and successfully create or clone a private repository.

Bu cavab sizə kömək etdi? 102 istifadəçi bunu faydalı hesab edir (444 səs)