简体   繁体   English

SSH 进入 private.network 中的 VM 不工作

[英]SSH into VM in private network not working

I had created several VMs in GCP in a private.network ie.我在 private.network ie 中的 GCP 中创建了几个虚拟机。 With no Public IP Address associated with the instances.没有与实例关联的公共 IP 地址。 The SSH Button from the console was useable and I was able to SSH to any instance at that time.控制台中的 SSH 按钮可用,当时我能够向任何实例发送 SSH。

The next week when I tried to SSH again, I was unable to click on SSH and it shows下周当我再次尝试 SSH 时,我无法点击 SSH,它显示

此实例没有外部 IP - 图片

I have not changed anything from my end.我没有改变任何东西。 All infrastructure is managed by terraform only and no one has changed that.所有基础设施仅由 terraform 管理,没有人改变这一点。

Can it be due to any other API enabling/disabling?是否是由于任何其他 API 启用/禁用? Any help would be really appreciated.任何帮助将非常感激。 Thank you谢谢

One thing that could be preventing you from establish a ssh connection to your VM is the IAM permissions. IAM 权限可能会阻止您与 VM 建立 ssh 连接。 If your IAM permissions have been edited recently,it could be an explanation of why the ssh is disabled.如果您的 IAM 权限最近被编辑过,这可能是 ssh 被禁用的原因的解释。 Please, check if you have a compute instance admin role on your VMs.请检查您的 VM 上是否具有计算实例管理员角色

You can also verify that the changes have been applied correctly by using the following command on the GCP shell:您还可以通过在 GCP shell 上使用以下命令来验证更改是否已正确应用:

gcloud policy-troubleshoot iam resource --principal-email=email \
    --permission=permission

This should give you further detail on your IAM settings for a given user, and maybe give you a clue about what may be causing you the ssh issue.这应该为您提供有关给定用户的 IAM 设置的更多详细信息,并且可能会为您提供有关可能导致您出现 ssh 问题的原因的线索。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM