首页 > 解决方案 > GCP Compute Engine // 连接被拒绝错误:(gcloud.compute.ssh)[/usr/bin/ssh] exited with return code [255]

问题描述

在 GCE 上工作.. 我认为引导磁盘超出容量。顿时僵住了。并且发生以下错误时

gcloud compute ssh

ssh: connect to host {my external address} port 22: Connection refused 
ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255].

地位

gcloud compute firewall-rules list

NAME                                     NETWORK  DIRECTION  PRIORITY  ALLOW                                                       DENY  DISABLED
allow-superset-related                   default  INGRESS    1000      tcp:22,tcp:8080,tcp:80,tcp:443,tcp:8088,tcp:8888,tcp:13080        False
default-allow-8080                       default  INGRESS    1000      tcp:8080,tcp:15672,tcp:5555                                       False
default-allow-http                       default  INGRESS    1000      tcp:80                                                            False
default-allow-https                      default  INGRESS    1000      tcp:443                                                           False
default-allow-icmp                       default  INGRESS    65534     icmp                                                              False
default-allow-internal                   default  INGRESS    65534     tcp:0-65535,udp:0-65535,icmp                                      False
default-allow-rdp                        default  INGRESS    65534     tcp:3389                                                          False
default-allow-ssh                        default  INGRESS    65534     tcp:22                                                            False

nmap {my external ip}

Starting Nmap 7.80 ( https://nmap.org ) at 2020-09-10 19:14 KST
Nmap scan report for **
Host is up (0.0032s latency).
Not shown: 995 closed ports
PORT     STATE    SERVICE
135/tcp  filtered msrpc
139/tcp  filtered netbios-ssn
445/tcp  filtered microsoft-ds
2869/tcp filtered icslap
4444/tcp filtered krb524

Nmap done: 1 IP address (1 host up) scanned in 1.25 seconds

gcloud compute connect-to-serial-port {my_instance}

...

[[0;32m  OK  [0m] Started Update UTMP about System Runlevel Changes.
[[0;32m  OK  [0m] Started Raise network interfaces.
[[0;32m  OK  [0m] Reached target Network.
[[0;32m  OK  [0m] Reached target Network is Online.
You are in emerg
Cannot open access to console, the root account is locked.
See sulogin(8) man page for more details.

Press Enter to continue

串行端口不是交互式的。

谁能帮忙?

标签: sshgoogle-cloud-platformgoogle-compute-enginegcloud

解决方案


您可以按照本指南或使用以下命令调整磁盘大小:

gcloud compute disks resize DISK_NAME --size DISK_SIZE

或使用控制台:

  1. 转到磁盘页面以查看项目中的地区永久性磁盘列表。
  2. 单击要调整大小的磁盘的名称。
  3. 在磁盘详细信息页面上,单击编辑
  4. 在“大小”字段中,输入磁盘的新大小。
  5. 单击保存以将更改应用到磁盘。

调整磁盘大小后,您必须调整文件系统的大小,以便操作系统可以访问额外的空间。

注意:不要将引导磁盘的大小调整到超过 2 TB,因为这是限制。


推荐阅读