Google Compute Engine - 在 debian 升级后无法通过 ssh 连接到它 [英] Google Compute Engine - can't ssh to it after debian upgrade

查看:38
本文介绍了Google Compute Engine - 在 debian 升级后无法通过 ssh 连接到它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将我的 Debian 实例从 wheezy 升级到 jessie.一切顺利.我重新启动了系统,无法再从计算引擎实例页面通过 ssh 连接到它.我注意到系统确实重新启动,具有不同的外部 IP 地址.我能够访问我在虚拟机上运行的 Web 服务器,所以我知道一切都已正确升级和重新启动.Google 为其分配了一个新的外部 IP,但我无法再登录.

I upgraded my Debian instance from wheezy to jessie. Everything went well. I rebooted the system and couldn't ssh to it anymore from the compute engine instance page. I noticed the system did reboot, with a different external IP address. I'm able to get to a web server I have running on the virtual machine, so I know everything upgraded and rebooted properly. Google assigned a new external IP to it and I can't login anymore.

推荐答案

您可以查看受影响实例的串行端口日志以获取有关该问题的可能线索.如果您有实例磁盘的快照,则可以创建新的 VM.根据问题,最近的更改可能影响了实例启动顺序和 sshd_config 文件.

You can review the serial-port logs of the affected instance for possible clue on the issue. If you have a snapshot of your instance disk, you can create a new VM. As per the issue, is possible that recent changes may have affected the instance boot sequence and the sshd_config file.

要解决此问题,您可以启用交互式访问,通过串口控制台连接实例,输入串口访问信息访问磁盘,查看ssh配置文件$ sudo vi/etc/ssh/sshd_config$ sudo vi/etc/ssh/ssh_config.

To troubleshoot this, you can enable interactive access, connect to the instance through the serial console and enter the serial port access information to access the disk, review the ssh config files$ sudo vi /etc/ssh/sshd_config and $ sudo vi /etc/ssh/ssh_config.

如果您没有串行控制台的 root 密码,您可以使用 启动脚本将其添加到您的实例中,如下所示:

If you don’t have a root password for the serial console, you could use a startup script to add it to your instance as follows:

  1. 转到 Google Cloud Platform 控制台中的虚拟机实例页面.
  2. 单击要为其添加启动脚本的实例.
  3. 点击页面顶部的编辑"按钮.
  4. 点击启用连接到串行端口"
  5. 在自定义元数据下,点击添加项目.
  6. 将Key"设置为startup-script"并将Value"设置为此脚本:

<代码>#!/bin/bashuseradd -G sudo 用户名echo '用户名:密码' |密码

示例:

<代码>#!/bin/bashuseradd -G sudo test1echo 'test1:pass@100' |密码

  1. 点击保存,然后点击页面顶部的重置.您可能需要等待一段时间才能重启实例.
  2. 点击页面上的连接到串口".
  3. 在新窗口中,您可能需要稍等片刻,然后按一下键盘上的 Enter 键;然后,您应该会看到登录提示.10.. 使用您提供的用户名和密码登录.

示例:用户名:test1 AND 密码:pass@100

您还可以共享经过清理的串行端口日志版本,以获取有关实例上可能发生的情况的更多信息.这不是由于 IP 地址的变化,但是串口日志应该能让我们更深入地了解.

You can also share a sanitized version of the serial port logs, for more information on what may be happening on the instance. This is not due to a change in IP address, however the serial port logs should give us more insight.

这篇关于Google Compute Engine - 在 debian 升级后无法通过 ssh 连接到它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆