我可以使用相同的 SSH 密钥登录所有 Ubuntu 实例gcp
,除了一个实例之外,管理员为我创建了一个用户,将我添加到sudo
和组,并在那里添加了我的公钥,但我仍然无法通过或通过SSH 命令admin
登录,错误消息始终为。ssh myname@ip
gcp
Permission denied (publickey)
- 我将的调试信息
ssh -vvvv myname@IP
与我可以访问的其他实例的日志进行了比较,发现第 97 行存在差异:- 知识产权不能登录到:
debug3: receive packet: type 51
- 知识产权能登录到:
receive packet: type 60
73 debug1: rekey in after 134217728 blocks 74 debug1: Will attempt key: /Users/myname/.ssh/id_rsa RSA SHA256:gbz... explicit agent 75 debug1: Will attempt key: myname@myname RSA SHA256:ge3... agent 76 debug1: Will attempt key: myname@myname RSA SHA256:Ckn... agent 77 debug2: pubkey_prepare: done 78 debug3: send packet: type 5 79 debug3: receive packet: type 7 80 debug1: SSH2_MSG_EXT_INFO received 81 debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521> 82 debug3: receive packet: type 6 83 debug2: service_accept: ssh-userauth 84 debug1: SSH2_MSG_SERVICE_ACCEPT received 85 debug3: send packet: type 50 86 debug3: receive packet: type 51 87 debug1: Authentications that can continue: publickey 88 debug3: start over, passed a different list publickey 89 debug3: preferred publickey,keyboard-interactive,password 90 debug3: authmethod_lookup publickey 91 debug3: remaining preferred: keyboard-interactive,password 92 debug3: authmethod_is_enabled publickey 93 debug1: Next authentication method: publickey 94 debug1: Offering public key: /Users/myname/.ssh/id_rsa RSA SHA256:gbz... explicit agent 95 debug3: send packet: type 50 96 debug2: we sent a publickey packet, wait for reply 97 debug3: receive packet: type 51 98 debug1: Authentications that can continue: publickey 99 debug1: Offering public key: myname@myname RSA SHA256:ge3... agent 100 debug3: send packet: type 50 101 debug2: we sent a publickey packet, wait for reply 102 debug3: receive packet: type 51 103 debug1: Authentications that can continue: publickey 104 debug1: Offering public key: myname@myname RSA SHA256:Ckn... agent 105 debug3: send packet: type 50 106 debug2: we sent a publickey packet, wait for reply 107 debug3: receive packet: type 51 108 debug1: Authentications that can continue: publickey 109 debug2: we did not send a packet, disable method 110 debug1: No more authentication methods to try. 111 myname@myname@ip: Permission denied (publickey).
- 知识产权不能登录到:
是否有人知道为什么我无法登录 IP type 51
,以及我是否应该重新创建id_rsa
密钥对;如果是这样,我是否能够登录其他实例,因为其他实例正在使用我当前的id_rsa
密钥而没有任何问题,而且我不确定重新创建它是否会产生新的问题?
~/.ssh
我在本地机器的[id_rsa
,google_compute_engine
, ]中有三对密钥,google_compute_engine2
出于调试目的,我要求管理员将所有公钥添加到该实例(即使id_rsa
有问题,其他两个也应该可行,但不确定为什么都不起作用)