GIT repo connection failed in cPanel
Asked Answered
L

3

20

I am having issue connecting git repo to cpanel. I have added SSH keys to cPanel from git correctly. Sometime repo are connecting and sometime i am getting following issue Error: “/usr/local/cpanel/3rdparty/bin/git” reported error code “128” when it ended: fatal: could not read Password for 'https://[email protected]': No such device or address

enter image description here

Thank you in advance

Lethargy answered 27/12, 2018 at 8:32 Comment(1)
Note: I was not able to to clone repo from codeberg.org, but I was able from gitlab.com. So, looks like codeberg is blocking ssh access, or something.Miley
S
19

I have added SSH keys to cPanel

Then you should use an SSH URL (git@server:user/repo), not an HTTPS one (which starts with https://...)

See "Guide to Git - Set Up Access to Private Repositories" from the CPanel Knowledge Base.

git clone [email protected]:MyStuff/private-repository.git

You can see here a typical BitBucket SSH URL:

[email protected]:<account_name>/<repo_name>.git
# or
ssh://[email protected]/<account_name>/<repo_name>.git

Note: the username for a BitBucket repo is always git.

Subsequence answered 27/12, 2018 at 8:37 Comment(4)
i got another error reported error code “128” when it ended: fatal: unable to look up [email protected] (port 9418) (Name or service not known)Phipps
@Phipps port 9418 is the default port of the git protocol, for URL starting with git://. Make sure to use an actual SSH URL.Subsequence
The documentation from cpanel you mentioned is deprecated. The new documentation is: Guide to Git™ - Set Up Access to Private RepositoriesIqbal
@Iqbal Thank you for this feedback. I have updated the URL and edited the answer accordingly.Subsequence
T
1

Also confirm that the repository is public, i just had this issue and figured my repository was private so it couldn't be found

Transcalent answered 8/12, 2020 at 21:8 Comment(1)
why is that a problem? SSH keys have access to private reposFork
T
1

Try the following:

ssh-keygen -t rsa -b 2048 -C "[email protected]"
Twosided answered 25/3, 2022 at 10:51 Comment(1)
Please read How to Answer and always remember that you are not merely solving the problem at hand, but also educating the OP and any future readers of this question and answer. Thus, please edit the answer to include an explanation as to why it works.Andromeda

© 2022 - 2024 — McMap. All rights reserved.