再次出现身份验证问题,GCP源存储库使用publickey



我必须做一个空白安装,并设置新的私钥。我已经根据https://cloud.google.com/source-repositories/docs/authentication创建了它。

xxxx@xxxxx.ch@source.developers.google.com: Permission denied (publickey). fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.

我已经按照文档尝试了多次。总是一样的。我已经用bitbucket安装了相同的公钥,并尝试克隆一个repo。效果很好。因此必须正确设置密钥。

我已经运行ssh -vT xxxx@xxxxx.ch@source.developers.google.com -p2022

输出:

OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
debug1: Connecting to source.developers.google.com [108.177.127.82] port 2022.
debug1: Connection established.
debug1: identity file C:\Users\schae/.ssh/id_rsa type 0
debug1: identity file C:\Users\schae/.ssh/id_rsa-cert type -1
debug1: identity file C:\Users\schae/.ssh/id_dsa type -1
debug1: identity file C:\Users\schae/.ssh/id_dsa-cert type -1
debug1: identity file C:\Users\schae/.ssh/id_ecdsa type -1
debug1: identity file C:\Users\schae/.ssh/id_ecdsa-cert type -1
debug1: identity file C:\Users\schae/.ssh/id_ed25519 type -1
debug1: identity file C:\Users\schae/.ssh/id_ed25519-cert type -1
debug1: identity file C:\Users\schae/.ssh/id_xmss type -1
debug1: identity file C:\Users\schae/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.1
debug1: Remote protocol version 2.0, remote software version Go
debug1: no match: Go
debug1: Authenticating to source.developers.google.com:2022 as 'xxxxx@xxxxxx.ch'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
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: ecdsa-sha2-nistp256 SHA256:AGvEpqYNMqsRNIviwyk4J4HM0lEylomDBKOWZsBn434
debug1: Host '[source.developers.google.com]:2022' is known and matches the ECDSA host key.
debug1: Found key in C:\Users\schae/.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: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
debug1: Will attempt key: C:\Users\schae/.ssh/id_rsa RSA SHA256:tV/7LTCWmmg0nL2v0iy5D9/zyyLm4C4wykndp764WlI
debug1: Will attempt key: C:\Users\schae/.ssh/id_dsa
debug1: Will attempt key: C:\Users\schae/.ssh/id_ecdsa
debug1: Will attempt key: C:\Users\schae/.ssh/id_ed25519
debug1: Will attempt key: C:\Users\schae/.ssh/id_xmss
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: C:\Users\schae/.ssh/id_rsa RSA SHA256:tV/7LTCWmmg0nL2v0iy5D9/zyyLm4C4wykndp764WlI
debug1: Server accepts key: C:\Users\schae/.ssh/id_rsa RSA SHA256:tV/7LTCWmmg0nL2v0iy5D9/zyyLm4C4wykndp764WlI
debug1: Authentication succeeded (publickey).
Authenticated to source.developers.google.com ([108.177.127.82]:2022).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
shell request failed on channel 0

在最后几行中,它表示:"身份验证成功"。所以我想有了钥匙,一切都会好起来的。但是我不能克隆存储库。我错过了什么?????

更新29.10.2021

该Google用户具有以下权限:创建、source.repos.get source.repos.list source.repos。更新(甚至更多),是的,用户也是"源存储库管理员">

也许还有一件事:一切都完美无缺,直到我不得不重新安装本地电脑并重新设置一切。在过去一年左右的时间里,没有出现任何问题。在重新安装之后,我所做的就是设置一个新的私钥/公钥,并在这里安装公钥https://source.cloud.google.com/user/ssh_keys我就不知道还能做什么了?

我又做了一些实验。我没有从.ssh文件夹中删除公钥和私钥。我已经从GCP和Bitbucket中删除了所有公钥。这两种情况下,我得到了相同的错误(很明显)。然后我将密钥添加到bitbucket ->工作得很好。然后,我将密钥添加到GCP中,并尝试克隆一个回购->没有成功。拒绝访问。

这个调试信息看起来很奇怪?这是什么意思?

shell request failed on channel 0

将key_type更改为ecdsa,这就成功了。这可能是某种缓存或某个键卡在某处。

最新更新