简体   繁体   English

无法连接到Google Cloud Platform上的ssh:

[英]Unable to connect to ssh on Google Cloud Platform:

We are unable to connect to 'VM'via ssh instance on Google Cloud platform. 我们无法通过Google Cloud平台上的ssh实例连接到“ VM”。 Here we are trying with the help of 'SSH' button available on the browser. 在这里,我们正在浏览器上使用“ SSH”按钮进行尝试。

But following message is received: We are unable to connect to the VM on the port 22. 但是收到以下消息:我们无法在端口22上连接到VM。

We have tried to Stop and Start the VM but did not help. 我们尝试停止并启动VM,但没有帮助。

You need to create a firewall rule that enables SSH access on port 22 for your VMs. 您需要创建一个防火墙规则,以在VM的端口22上启用SSH访问。 It is better to make the 'Target' as a network tag instead of enabling SSH access for all of the machines on your VPC network. 最好将“目标”作为网络标签,而不是对VPC网络上的所有计算机启用SSH访问。

You can use the CLI to perform this operation - using the default VPC 您可以使用CLI执行此操作-使用默认的VPC

gcloud compute firewall-rules create <rule-name> --allow tcp:22 --network "default" --source-ranges "<source-range>"

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

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