GCP VM 的公钥身份验证不再起作用

GCP VM 的公钥身份验证不再起作用

我有 3 个无法通过 ssh 连接的 Google VM。它以前可以工作,但现在停止了,我无论如何也想不出原因。

我已确认两台机器上的 .ssh 和密钥的权限。密钥是通过 GCP 界面添加的,并在 authorized_hosts 中进行了验证

在客户端,这是我获得的调试信息

debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,[email protected]
debug2: compression stoc: none,[email protected]
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
debug3: hostkeys_foreach: reading file "/home/XXXX/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /home/XXXX/.ssh/known_hosts:2
debug3: load_hostkeys: loaded 1 keys from XX.XX.XX.XX
debug1: Host 'XX.XX.XX.XX' is known and matches the ECDSA host key.
debug1: Found key in /home/XXXX/.ssh/known_hosts:2
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey after 134217728 blocks
debug2: key: /home/XXXX/.ssh/id_rsa2 (0x7fffd51f62c0), explicit
debug3: send packet: type 5
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 1
Received disconnect from XX.XX.XX.XX port 22:2: Connection blocked because server only allows public key authentication. Please contact your network administrator.

查看服务器上的 auth.log,我得到:8 月 9 日 20:48:31 XXXX sshd[18975]: 正在验证用户 XXXX XX.XX.XX.XX 端口 57813 [preauth] 已关闭连接

因此,这两台机器似乎在互相指责,说“是他们干的”

这是我的配置文件:

Host XXXX
        User XXXX
        HostName XX.XX.XX.XX
        IdentityFile ~/.ssh/id_rsa2
        ServerAliveInterval 120
        ServerAliveCountMax 30

我没有主意了,有人可以帮忙吗?

相关内容