无法通过 SSH 登录 GCE 实例,而 gcloud compute 运行正常

无法通过 SSH 登录 GCE 实例,而 gcloud compute 运行正常

在我的一个 Google Compute 引擎实例中,我可以使用 gcloud 命令登录: gcloud compute --project "我的项目" ssh --zone "区域名称" "实例名称"

但我无法使用远程控制按钮,或者从命令提示符。下面是串行版本输出

9 月 7 日 02:00:35 my-gce-instance sshd[25823]: 来自 291.107.144.97 的无效用户管理员

9 月 7 日 02:00:35 my-gce-instance sshd[25823]: input_userauth_request: 无效的用户管理员 [preauth]

9 月 7 日 02:00:37 my-gce-instance sshd[25823]: 断开连接:管理员身份验证失败次数过多 [preauth]

9 月 7 日 02:13:46 my-gce-instance sshd[26019]: 来自 198.180.78.102 的用户管理员无效

9 月 7 日 02:13:46 my-gce-instance sshd[26019]: input_userauth_request: 无效的用户管理员 [preauth]

9 月 7 日 02:13:48 my-gce-instance sshd[26019]: 断开连接:管理员身份验证失败次数过多 [preauth]

9 月 7 日 02:40:21 my-gce-instance sshd[26426]: 从 184.145.49.97 端口 56371 接受 gsc 的公钥 ssh2: RSA c6:71:77:6d:56:e2:fb:b9:90:7d:df:bb:76:51:12:9a

9 月 7 日 02:40:21 my-gce-instance sshd[26428]: 收到来自 184.145.49.97 的断开连接:11:用户断开连接

9 月 7 日 02:47:00 my-gce-instance sshd[26521]: 来自 193.107.155.192 的无效用户 xml2epay

9 月 7 日 02:47:00 my-gce-instance sshd[26521]: input_userauth_request: 无效用户 xml2epay [preauth]

9 月 7 日 02:47:01 my-gce-instance sshd[26521]: 连接由 193.107.155.192 [preauth] 关闭

9 月 7 日 02:49:54 my-gce-instance sshd[26567]: 连接由 96.58.125.162 [preauth] 关闭

9 月 7 日 02:56:36 my-gce-instance sshd[26673]: 从 45.174.197.98 端口 57017 接受 xxxx 的公钥 ssh2: RSA 89:3a:9c:6e:2a:e3:bb:83:bb:da:4b:ac:c9:b5:c8:64

9 月 7 日 03:01:21 my-gce-instance sshd[26769]: 来自 92.100.179.159 的用户管理员无效

9 月 7 日 03:01:21 my-gce-instance sshd[26769]: input_userauth_request: 无效的用户管理员 [preauth]

9 月 7 日 03:01:22 my-gce-instance sshd[26770]: 来自 92.100.179.159 的用户管理员无效

9 月 7 日 03:01:22 my-gce-instance sshd[26770]: input_userauth_request: 无效的用户管理员 [preauth]

9 月 7 日 03:01:25 my-gce-instance sshd[26769]: 断开连接:管理员身份验证失败次数过多 [preauth]

9 月 7 日 03:01:27 my-gce-instance sshd[26770]: 断开连接:管理员身份验证失败次数过多 [preauth]

9 月 7 日 03:01:37 my-gce-instance sshd[26773]: 断开连接:root 身份验证失败次数过多 [preauth]

9 月 7 日 03:01:46 my-gce-instance sshd[26775]: 断开连接:root 身份验证失败次数过多 [preauth]

9 月 7 日 03:01:51 my-gce-instance sshd[26777]: 来自 92.100.179.159 的无效用户 usuario

9 月 7 日 03:01:51 my-gce-instance sshd[26777]: input_userauth_request: 无效用户 usuario [preauth]

9 月 7 日 03:02:01 my-gce-instance sshd[26777]: 断开连接:usuario 身份验证失败次数过多 [preauth]

9 月 7 日 03:04:35 my-gce-instance sshd[26838]: 连接由 78.195.41.87 [preauth] 关闭

9 月 7 日 03:04:38 my-gce-instance sshd[26840]: 连接由 143.188.93.184 [preauth] 关闭

9 月 7 日 03:04:42 my-gce-instance sshd[26842]: 连接由 143.188.93.180 [preauth] 关闭

9 月 7 日 03:04:45 my-gce-instance sshd[26844]: 连接由 143.188.93.98 [preauth] 关闭

答案1

  • 拍摄快照以进行备份,以防出现问题,您可以恢复您的虚拟机实例。
  • 通过命令 SSH 进入虚拟机实例gcloud
  • 运行以下命令来删除旧版本的 GCE 守护进程:

    sudo apt-get purge --auto-remove gce-daemon gce-startup-scripts gce-cloud-config**
    
  • 然后运行此命令来安装新的 GCE 守护进程:

    sudo apt-get install --reinstall gce-compute-image-packages python-google-compute-engine**
    
  • 重新启动实例,然后尝试通过 Web 浏览器进行 SSH。

相关内容