SSH Expired on GCP VM Instance



我已经创建了一个虚拟机实例,它连接到外部ip与http,但不与https。在检查日志时,显示以下错误:


无效的ssh密钥条目-过期密钥:ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJdFE+rHGtkgTx0niNZRTQYb.................jH8ycULWLplemekTGdFnwoGhNb google-ssh {"userName":"my_user_name@gmail.com","expireOn"; "2022-12-06T17:04:46+000 "}


有人知道为什么会发生这种情况或如何解决这个问题吗?我花了至少10个小时试图解决这个问题,但我没有成功,因为我不是技术领域的人。

我试着

  • 创建一个新的ssh密钥-首先我从来没有这样做过-然后在元数据或通过控制台终端等更新它。
  • 我试着直接添加一个新的ssh密钥,但没有工作

编辑按照注释运行以下命令:

gcloud compute project-info describe --format flattened

结果如下:

commonInstanceMetadata.fingerprint:    mgT7F7wYfBw=
commonInstanceMetadata.items[0].key:   ssh-keys
commonInstanceMetadata.items[0].value: himanshusomani007:ssh-rsa AAAAB3NzaC1yc2EAAAADAQA..........cULWLplemekTGdFnwoGhNb google-ssh {"userName":"my_user_name@gmail.com","expireOn":"2023-12-04T17:04:46+0000"}
commonInstanceMetadata.kind:           compute#metadata
creationTimestamp:                     2022-11-17T00:15:29.195-08:00
defaultNetworkTier:                    PREMIUM
defaultServiceAccount:                 1054284009344-compute@developer.gserviceaccount.com
id:                                    3401782412795466575
kind:                                  compute#project
name:                                  principal-storm-368908
quotas[0].limit:                       1000.0
quotas[0].metric:                      SNAPSHOTS
quotas[0].usage:                       0.0
quotas[1].limit:                       5.0
quotas[1].metric:                      NETWORKS
quotas[1].usage:                       1.0
quotas[2].limit:                       100.0
quotas[2].metric:                      FIREWALLS
quotas[2].usage:                       9.0
quotas[3].limit:                       100.0
quotas[3].metric:                      IMAGES
quotas[3].usage:                       0.0
quotas[4].limit:                       8.0
quotas[4].metric:                      STATIC_ADDRESSES
quotas[4].usage:                       0.0
quotas[5].limit:                       200.0
quotas[5].metric:                      ROUTES
quotas[5].usage:                       1.0
quotas[6].limit:                       15.0
quotas[6].metric:                      FORWARDING_RULES
quotas[6].usage:                       0.0
quotas[7].limit:                       50.0
quotas[7].metric:                      TARGET_POOLS
quotas[7].usage:                       0.0
quotas[8].limit:                       50.0
quotas[8].metric:                      HEALTH_CHECKS
quotas[8].usage:                       0.0
quotas[9].limit:                       8.0
quotas[9].metric:                      IN_USE_ADDRESSES
quotas[9].usage:                       0.0
quotas[10].limit:                      50.0
quotas[10].metric:                     TARGET_INSTANCES
quotas[10].usage:                      0.0
quotas[11].limit:                      10.0
quotas[11].metric:                     TARGET_HTTP_PROXIES
quotas[11].usage:                      0.0
quotas[12].limit:                      10.0
quotas[12].metric:                     URL_MAPS
quotas[12].usage:                      0.0
quotas[13].limit:                      50.0
quotas[13].metric:                     BACKEND_SERVICES
quotas[13].usage:                      0.0
quotas[14].limit:                      100.0
quotas[14].metric:                     INSTANCE_TEMPLATES
quotas[14].usage:                      0.0
quotas[15].limit:                      5.0
quotas[15].metric:                     TARGET_VPN_GATEWAYS
quotas[15].usage:                      0.0
quotas[16].limit:                      10.0
quotas[16].metric:                     VPN_TUNNELS
quotas[16].usage:                      0.0
quotas[17].limit:                      3.0
quotas[17].metric:                     BACKEND_BUCKETS
quotas[17].usage:                      0.0
quotas[18].limit:                      10.0
quotas[18].metric:                     ROUTERS
quotas[18].usage:                      0.0
quotas[19].limit:                      10.0
quotas[19].metric:                     TARGET_SSL_PROXIES
quotas[19].usage:                      0.0
quotas[20].limit:                      10.0
quotas[20].metric:                     TARGET_HTTPS_PROXIES
quotas[20].usage:                      0.0
quotas[21].limit:                      10.0
quotas[21].metric:                     SSL_CERTIFICATES
quotas[21].usage:                      0.0
quotas[22].limit:                      100.0
quotas[22].metric:                     SUBNETWORKS
quotas[22].usage:                      0.0
quotas[23].limit:                      10.0
quotas[23].metric:                     TARGET_TCP_PROXIES
quotas[23].usage:                      0.0
quotas[24].limit:                      32.0
quotas[24].metric:                     CPUS_ALL_REGIONS
quotas[24].usage:                      1.0
quotas[25].limit:                      10.0
quotas[25].metric:                     SECURITY_POLICIES
quotas[25].usage:                      0.0
quotas[26].limit:                      100.0
quotas[26].metric:                     SECURITY_POLICY_RULES
quotas[26].usage:                      0.0
quotas[27].limit:                      1000.0
quotas[27].metric:                     XPN_SERVICE_PROJECTS
quotas[27].usage:                      0.0
quotas[28].limit:                      20.0
quotas[28].metric:                     PACKET_MIRRORINGS
quotas[28].usage:                      0.0
quotas[29].limit:                      100.0
quotas[29].metric:                     NETWORK_ENDPOINT_GROUPS
quotas[29].usage:                      0.0
quotas[30].limit:                      6.0
quotas[30].metric:                     INTERCONNECTS
quotas[30].usage:                      0.0
quotas[31].limit:                      5000.0
quotas[31].metric:                     GLOBAL_INTERNAL_ADDRESSES
quotas[31].usage:                      0.0
quotas[32].limit:                      5.0
quotas[32].metric:                     VPN_GATEWAYS
quotas[32].usage:                      0.0
quotas[33].limit:                      100.0
quotas[33].metric:                     MACHINE_IMAGES
quotas[33].usage:                      0.0
quotas[34].limit:                      20.0
quotas[34].metric:                     SECURITY_POLICY_CEVAL_RULES
quotas[34].usage:                      0.0
quotas[35].limit:                      0.0
quotas[35].metric:                     GPUS_ALL_REGIONS
quotas[35].usage:                      0.0
quotas[36].limit:                      5.0
quotas[36].metric:                     EXTERNAL_VPN_GATEWAYS
quotas[36].usage:                      0.0
quotas[37].limit:                      1.0
quotas[37].metric:                     PUBLIC_ADVERTISED_PREFIXES
quotas[37].usage:                      0.0
quotas[38].limit:                      10.0
quotas[38].metric:                     PUBLIC_DELEGATED_PREFIXES
quotas[38].usage:                      0.0
quotas[39].limit:                      128.0
quotas[39].metric:                     STATIC_BYOIP_ADDRESSES
quotas[39].usage:                      0.0
quotas[40].limit:                      10.0
quotas[40].metric:                     NETWORK_FIREWALL_POLICIES
quotas[40].usage:                      0.0
quotas[41].limit:                      15.0
quotas[41].metric:                     INTERNAL_TRAFFIC_DIRECTOR_FORWARDING_RULES
quotas[41].usage:                      0.0
quotas[42].limit:                      15.0
quotas[42].metric:                     GLOBAL_EXTERNAL_MANAGED_FORWARDING_RULES
quotas[42].usage:                      0.0
selfLink:                              https://www.googleapis.com/compute/v1/projects/principal-storm-368908
vmDnsSetting:                          ZONAL_ONLY
xpnProjectStatus:                      UNSPECIFIED_XPN_PROJECT_STATUS

从您的描述共享的错误ssh密钥过期。

您需要创建一个新的rsa密钥

ssh-keygen

然后复制VM实例部分ssh key中的新公钥。

请!复制公钥而不是私钥,您可以使用扩展名.pub

识别公钥按照这里的指示操作

相关内容

  • 没有找到相关文章

最新更新