【发布时间】:2022-01-11 12:07:06
【问题描述】:
我有一个使用 Debian 操作系统的 Google 云虚拟机实例。我已经托管了 Wordpress 网站。升级操作系统版本后一切正常,我可以使用“在浏览器中打开 SSH”选项通过 SSH 连接。
现在我尝试使用“在浏览器中打开 SSH”连接我的虚拟机实例,它只是不断重试。我检查了串行控制台输出,但没有错误消息。请参考以下
但是,我可以使用相同的密钥通过 FTP 进行连接,但是当我尝试通过 SSH 连接时遇到了问题。我检查了该实例和项目的端口 22,它是打开的
以下是我重新启动虚拟机后串行控制台日志的最后几行,
Dec 6 09:01:20 localhost sendmail[383]: Starting Mail Transport Agent (MTA): sendmail.
Dec 6 09:01:20 localhost systemd[1]: Started LSB: powerful, efficient, and scalable Mail Transport Agent.
Dec 6 09:01:21 localhost systemd[1]: Started MariaDB 10.3.31 database server.
Dec 6 09:01:21 localhost systemd[1]: Reached target Multi-User System.
Dec 6 09:01:21 localhost systemd[1]: Reached target Graphical InterfacDec 6 09:01:21 localhost systemd[1]: Startup finished in 4.063s (kernel) + 9.852s (userspace) = 13.915s.
Dec 6 09:01:21 localhost /etc/mysql/debian-start[567]: Upgrading MySQL tables if necessary.
Dec 6 09:01:21 localhost /etc/mysql/debian-start[570]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
Dec 6 09:01:21 localhost /etc/mysql/debian-start[570]: Looking for 'mysql' as: /usr/bin/mysql
Dec 6 09:01:21 localhost /etc/mysql/debian-start[570]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Dec 6 09:01:21 localhost /etc/mysql/debian-start[570]: Version check failed. Got the following error when calling the 'mysql' command line client
Dec 6 09:01:21 localhost /etc/mysql/debian-start[570]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Dec 6 09:01:21 localhost /etc/mysql/debian-start[570]: FATAL ERROR: Upgrade failed
Dec 6 09:01:21 localhost /etc/mysql/debian-start[580]: Checking for insecure root accounts.
Dec 6 09:01:21 localhost debian-start[564]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Debian GNU/Linux 10 localhost ttyS0
localhost login: Dec 6 09:01:28 localhost systemd[1]: Stopping User Manager for UID 110...
Dec 6 09:01:28 localhost systemd[497]: Stopped target Default.
Dec 6 09:01:28 localhost systemd[497]: Stopped target Basic System.
Dec 6 09:01:28 localhost systemd[497]: Stopped target Timers.
Dec 6 09:01:28 localhost systemd[497]: Stopped target Paths.
Dec 6 09:01:28 localhost systemd[497]: Stopped target Sockets.
Dec 6 09:01:28 localhost systemd[497]: gpg-agent-browser.socket: Succeeded.
Dec 6 09:01:28 localhost systemd[497]: Closed GnuPG cryptographic agent and passphrase cache (access for web browsers).
Dec 6 09:01:28 localhost systemd[497]: dirmngr.socket: Succeeded.
Dec 6 09:01:28 localhost systemd[497]: Closed GnuPG network certificate management daemon.
Dec 6 09:01:28 localhost systemd[497]: gpg-agent-ssh.socket: Succeeded.
Dec 6 09:01:28 localhost systemd[497]: Closed GnuPG cryptographic agent (ssh-agent emulation).
Dec 6 09:01:28 localhost systemd[497]: gpg-agent.socket: Succeeded.
Dec 6 09:01:28 localhost systemd[497]: Closed GnuPG cryptographic agent and passphrase cache.
Dec 6 09:01:28 localhost systemd[497]: gpg-agent-extra.socket: Succeeded.
Dec 6 09:01:28 localhost systemd[497]: Closed GnuPG cryptographic agent and passphrase cache (restricted).
Dec 6 09:01:28 localhost systemd[497]: Reached target Shutdown.
Dec 6 09:01:28 localhost systemd[497]: systemd-exit.service: Succeeded.
Dec 6 09:01:28 localhost systemd[497]: Started Exit the Session.
Dec 6 09:01:28 localhost systemd[497]: Reached target Exit the Session.
Dec 6 09:01:28 localhost systemd[1]: user@110.service: Succeeded.
Dec 6 09:01:28 localhost systemd[1]: Stopped User Manager for UID 110.
Dec 6 09:01:28 localhost systemd[1]: Stopping User Runtime Directory /run/user/110...
Dec 6 09:01:28 localhost systemd[1]: run-user-110.mount: Succeeded.
Dec 6 09:01:28 localhost systemd[1]: user-runtime-dir@110.service: Succeeded.
Dec 6 09:01:28 localhost systemd[1]: Stopped User Runtime Directory /run/user/110.
Dec 6 09:01:28 localhost systemd[1]: Removed slice User Slice of UID 110.
尝试了我从谷歌搜索获得的以下解决方案
解决方案 1:使用 PuTTYGen 和 Putty
使用 PuttyGen 生成密钥并将公钥放在元数据下,并尝试在实例下添加。我已将enable-oslogin 设置为FALSE。
但收到以下错误消息。
解决方案 2:使用串行端口
当我尝试使用差异串行端口进行连接时,它只是在连接屏幕上堆叠,我检查了该串行端口的控制台日志,但它是空白的。
解决方案 3:带有磁盘映像的新实例
创建当前磁盘的映像,然后使用该映像创建新实例。当我尝试连接到那个新实例时,我遇到了同样的问题。
解决方案 4:使用 diff 机器设置 CLI
我在新机器上设置了新的 Google Cloud CLI 并尝试连接但没有成功。我遇到了同样的错误。
解决方案 5:增加磁盘空间
将磁盘空间从 20GB 增加到 35GB,但没有用。通常如果存在磁盘空间错误,我们会将其写入串行控制台日志。但就我而言,串行控制台日志中没有错误消息。
如果需要任何其他信息,请提供帮助并告诉我。 谢谢
【问题讨论】:
-
您可以尝试troubleshooting ssh 步骤并告诉我这是否解决了您的问题吗?
-
提示:对于串口屏,进程正在等待输入。按 ENTER。但是,如果您之前没有设置登录名,那么您将只能查看输出。这对于在服务器端观看 SSH 登录很有用。
-
@BakulMitra 这是 trubleshoot 命令 prnt.sc/225kiqv 的输出。这并不能解决问题。
-
@JohnHanley 我尝试按 ENTER 但没有继续。我可能没有以正确的方式使用它。请指导
标签: google-cloud-platform ssh google-compute-engine google-cloud-sdk