Reputation: 506
I'm trying to clone my git repository on cpanel via bluehost, to deploy my website, however, I continue to get the follow error:
Error: (XID za7xwb) “/usr/local/cpanel/3rdparty/bin/git” reported error code “128” when it ended: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
I first generated ssh keys via Gitbash. Following Githubs docs -- https://docs.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
After such, I went to github - settings -- ssh - and added the respective key.
Next, I went to bluehost - cpanel -- add ssh keys -- and added both public and private keys and authorized them.
Next. via the cpanel on bluehost I used -- [email protected]:JAVandenberg/DeltaDesigns.git -- to clone the private repository. However, I am continued to be met with the same error.
Next I did this
Warning: Permanently added the RSA host key for IP address '140.82.121.4' to the list of known hosts.
Hi JAVandenberg! You've successfully authenticated, but GitHub does not provide shell access.
While this doesn't provide shell access, authorizing the same ssh keys used on cpanel should have given it access I would image?
I also tried this to debug following -- https://docs.github.com/en/github/authenticating-to-github/error-permission-denied-publickey -- but with no avail
OpenSSH_8.4p1, OpenSSL 1.1.1h 22 Sep 2020
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to github.com [140.82.121.3] port 22.
debug1: Connection established.
debug1: identity file /c/Users/james/.ssh/id_rsa type -1
debug1: identity file /c/Users/james/.ssh/id_rsa-cert type -1
debug1: identity file /c/Users/james/.ssh/id_dsa type -1
debug1: identity file /c/Users/james/.ssh/id_dsa-cert type -1
debug1: identity file /c/Users/james/.ssh/id_ecdsa type -1
debug1: identity file /c/Users/james/.ssh/id_ecdsa-cert type -1
debug1: identity file /c/Users/james/.ssh/id_ecdsa_sk type -1
debug1: identity file /c/Users/james/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /c/Users/james/.ssh/id_ed25519 type 3
debug1: identity file /c/Users/james/.ssh/id_ed25519-cert type -1
debug1: identity file /c/Users/james/.ssh/id_ed25519_sk type -1
debug1: identity file /c/Users/james/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /c/Users/james/.ssh/id_xmss type -1
debug1: identity file /c/Users/james/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.4
debug1: Remote protocol version 2.0, remote software version babeld-7bdc42c4
debug1: no match: babeld-7bdc42c4
debug1: Authenticating to github.com:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: rsa-sha2-512
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /c/Users/james/.ssh/known_hosts:1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /c/Users/james/.ssh/id_rsa
debug1: Will attempt key: /c/Users/james/.ssh/id_dsa
debug1: Will attempt key: /c/Users/james/.ssh/id_ecdsa
debug1: Will attempt key: /c/Users/james/.ssh/id_ecdsa_sk
debug1: Will attempt key: /c/Users/james/.ssh/id_ed25519 ED25519 SHA256:9TUNWNIQjgcXmRCngAxEcwBDOpzOPN8KtK6U2O4zmLM
debug1: Will attempt key: /c/Users/james/.ssh/id_ed25519_sk
debug1: Will attempt key: /c/Users/james/.ssh/id_xmss
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /c/Users/james/.ssh/id_rsa
debug1: Trying private key: /c/Users/james/.ssh/id_dsa
debug1: Trying private key: /c/Users/james/.ssh/id_ecdsa
debug1: Trying private key: /c/Users/james/.ssh/id_ecdsa_sk
debug1: Offering public key: /c/Users/james/.ssh/id_ed25519 ED25519 SHA256:9TUNWNIQjgcXmRCngAxEcwBDOpzOPN8KtK6U2O4zmLM
debug1: Server accepts key: /c/Users/james/.ssh/id_ed25519 ED25519 SHA256:9TUNWNIQjgcXmRCngAxEcwBDOpzOPN8KtK6U2O4zmLM
debug1: Authentication succeeded (publickey).
Authenticated to github.com ([140.82.121.3]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
Hi JAVandenberg! You've successfully authenticated, but GitHub does not provide shell access.
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 2192, received 2244 bytes, in 0.2 seconds
Bytes per second: sent 10113.5, received 10353.4
debug1: Exit status 1
And it shows it has been authorized.
It feels like there is something I'm missing but I can't quite figure it out.
I also, tried adding a deploy key, but then it says the key is already in use -- I'm a little unsure of how the ssh keys work between the repository (deploy key) -- github ssh key -- and the cpanel. What's the line of communication like?
Any help would be great!
Thanks :)
Upvotes: 1
Views: 4172
Reputation: 1325996
Added both public and private keys and authorized them.
Wait... only the public key is supposed to be added around, not the private key, which is supposed to remain, err... private.
The SSH Access on Bluehost cPanel differs from the SSH access to a GitHub repository.
Try on cPanel, just before git clone, an export GIT_SSH_COMMAND='ssh -v'
: you will see what keys are tried. The private key ~/.ssh/id_rsa
in that cPanel session should be the one whose public key you have registered on GitHub side.
As noted in the conversion by the OP:
I was working with tech support on blue host- and apparently what I'm doing, since it requires root access -- needs a vps hosting service, NOT shared hosting, which I originally bought.
So I have to cancel the account and sign up to their vps instead.... which is a fair bit more expensive :(
Upvotes: 1