简体   繁体   English

SSH 关键问题 Git-CPanel - 权限被拒绝(公钥)。 致命:无法从远程存储库中读取

[英]SSH Key Issues Git-CPanel - Permission denied (publickey). fatal: Could not read from remote repository

I'm trying to clone my git repository on cpanel via bluehost, to deploy my website, however, I continue to get the follow error:我正在尝试通过 bluehost 在 cpanel 上克隆我的 git 存储库,以部署我的网站,但是,我继续收到以下错误:

Error: (XID za7xwb) “/usr/local/cpanel/3rdparty/bin/git” reported error code “128” when it ended: Permission denied (publickey).错误:(XID za7xwb)“/usr/local/cpanel/3rdparty/bin/git”结束时报告错误代码“128”:权限被拒绝(公钥)。 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.我首先通过 Gitbash 生成了 ssh 密钥。 Following Githubs docs -- https://docs.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent遵循 Githubs 文档——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.之后,我去了 github - 设置 - ssh - 并添加了相应的密钥。

Next, I went to bluehost - cpanel -- add ssh keys -- and added both public and private keys and authorized them.接下来,我去bluehost - cpanel - 添加ssh 密钥 - 并添加公钥和私钥并对其进行授权。

Next.下一个。 via the cpanel on bluehost I used -- git@github.com:JAVandenberg/DeltaDesigns.git -- to clone the private repository.通过我使用的 bluehost 上的 cpanel -- git@github.com:JAVandenberg/DeltaDesigns.git -- 克隆私有存储库。 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?虽然这不提供 shell 访问权限,但授权 cpanel 上使用的相同 ssh 密钥应该可以访问我想像的权限?

I also tried this to debug following -- https://docs.github.com/en/github/authenticating-to-github/error-permission-denied-publickey -- but with no avail我也试过这个来调试以下 - https://docs.github.com/en/github/authenticating-to-github/error-permission-denied-publickey - 但无济于事

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: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com 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=<ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,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.我也尝试添加部署密钥,但随后它说该密钥已在使用中-我有点不确定 ssh 密钥在存储库之间的工作方式(部署密钥)-- github Z1787D76446304C5D987CFE 和643 c5D977CFE 密钥. What's the line of communication like?通讯线路是怎样的?

Any help would be great!任何帮助都会很棒!

Thanks:)谢谢:)

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 .等等...应该只添加公钥,而不是应该保留的私钥,错误... private

The SSH Access on Bluehost cPanel differs from the SSH access to a GitHub repository. Bluehost cPanel 上的 SSH 访问不同于 SSH 对 GitHub 存储库的访问。

Try on cPanel, just before git clone, an export GIT_SSH_COMMAND='ssh -v' : you will see what keys are tried.尝试在 cPanel 上,在 git 克隆之前, export GIT_SSH_COMMAND='ssh -v' :您将看到尝试了哪些密钥。 The private key ~/.ssh/id_rsa in that cPanel session should be the one whose public key you have registered on GitHub side. cPanel session 中的~/.ssh/id_rsa应该是您在 GitHub 端注册的公钥。

As noted in the conversion by the OP :正如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.我正在与蓝色主机上的技术支持合作——显然我正在做的事情,因为它需要 root 访问权限——需要一个 vps 托管服务,而不是我最初购买的共享托管。
So I have to cancel the account and sign up to their vps instead.... which is a fair bit more expensive:(所以我必须取消帐户并注册他们的vps....这有点贵:(

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 GIT 权限被拒绝(公钥) - 致命无法从远程存储库读取 - GIT permission denied (publickey) - Fatal could not read from remote repository Git:权限被拒绝(公钥)。 致命:无法从远程存储库读取 - Git: Permission denied (publickey). fatal: Could not read from remote repository 使用ssh访问bitbucket的Jenkins git插件:权限被拒绝(publickey)。 致命:无法从远程存储库读取 - Jenkins git plugin with ssh access to bitbucket: Permission denied (publickey). fatal: Could not read from remote repository 通过 SSH 从远程服务器推送 git commit:权限被拒绝(公钥)。 致命:无法从远程存储库读取 - Pushing git commit from remote server through SSH: Permission denied (publickey). fatal: Could not read from remote repository Git:权限被拒绝(公钥)致命 - 无法从远程存储库读取。 克隆 Git 存储库时 - Git: Permission denied (publickey) fatal - Could not read from remote repository. while cloning Git repository 权限被拒绝(公钥)。 严重的:无法从远程存储库读取 - Permission denied (publickey). fatal: Could not read from remote repository GitHub:权限被拒绝(公钥)。 致命:无法从远程存储库读取 - GitHub: Permission denied (publickey). fatal: Could not read from remote repository 权限被拒绝(公钥)。 严重的:无法从远程存储库读取 - Permission denied (publickey). fatal: Could not read from remote repository Git 子模块:git@github.com:权限被拒绝(公钥)。 致命:无法从远程存储库中读取 - Git submodule: git@github.com: Permission denied (publickey). fatal: Could not read from remote repository Heroku:权限被拒绝(公钥)。 致命的:执行git push时无法从远程存储库读取 - Heroku: Permission denied (publickey). fatal: Could not read from remote repository when doing git push
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM