Google 计算引擎 Ubuntu-OpenSSL 1.1.1a

Google 计算引擎 Ubuntu-OpenSSL 1.1.1a

在运行 Google Compute Engine 的 Ubuntu 18.04.1 LTS 服务器上执行操作后,apt-get upgrade我无法通过 WEB SSH 连接到我的服务器。窗口卡住了,显示以下消息:

Transferring SSH keys to the VM.
The key transfer to project metadata is taking an unusually long time. Transferring instead to instance metadata may be faster, but will transfer the keys only to this VM.

经过一番调查,由于频繁的快照,发现 apt-get upgrade 已将openssl版本更新为1.1.1a-2+ubuntu18.04.1+deb.sury.org+1。此升级似乎禁用了 WEB SSH 与服务器之间的通信。以前只解决过此问题吗?

答案1

有时这些类型的问题是暂时的,如果实例在初始尝试期间仍在启动,则以下 SSH 连接尝试将会成功。

您在 auth.log 中发现的错误非常普遍,您可以查看串行控制台输出 查看一些额外的详细信息来帮助您解决问题。

如果您确定了问题的可能根本原因,则可以启用交互式访问串行控制台要解决这个问题。

如果你没有 root 密码,你可以:

1. Go to the VM instances page in Google Cloud Platform console. 
2. Click on the instance for which you want to add a startup script. 
3. Click the Edit button at the top of the page.
4. Click on ‘Enable connecting to serial ports’
5. Under Custom metadata, click Add item. 
6. Set 'Key' to 'startup-script' and set 'Value' to this script: 
#! /bin/bash 
useradd -G sudo USERNAME 
echo 'USERNAME:PASSWORD' | chpasswd 
7. Click Save and then click RESET on the top of the page. You might need to wait for some time for the instance to reboot. 
8. Click on 'Connect to serial port' in the page. 
9.  In the new window, you might need to wait a bit and press on Enter of your keyboard once; then, you should see the login prompt. 
10.. Login using the USERNAME and PASSWORD you provided.

串行控制台访问并不安全,因此建议您在完成工作后禁用它。

您还可以通过运行来调试SSH 诊断来自的脚本Linux 客户机环境这些都包含在使用 Google 提供的公共映像创建的 Linux 实例中。

相关内容