简体   繁体   English

google cloud vm ssh.network 错误:连接超时

[英]google cloud vm ssh network error: connection timed out

I'm trying to ssh into a GCP Linux VM from my local Windows 10 machine using google cloud SDK.我正在尝试使用谷歌云 SDK 从本地 Windows 10 机器将 ssh 转换为 GCP Linux VM。

I have two wifi.networks at home.我家里有两个 wifi.networks。 When I run the command gcloud compute ssh VM_name , I can connect to the VM through only one of the.networks.当我运行命令gcloud compute ssh VM_name ,我只能通过其中一个 .networks 连接到 VM。 On the other.network, I receive the following error from puTTy:在 other.network 上,我从 PuTTy 收到以下错误:

puTTy FATAL ERROR: Network error. PuTTy 致命错误:网络错误。 Connection timed out.连接超时。

Both.networks are from the same inte.net service provider. Both.networks 来自同一个 inte.net 服务提供商。 Why is it not connecting through one of them?为什么它不通过其中之一连接? Which settings should I look into?我应该查看哪些设置?

As per this doc To address a common fatal error that many users have experienced using the PuTTY software, which goes as follows: A fatal error occurs when the software throws an error without warning or saving its state, rendering the user unable to carry out any additional actions.根据此文档解决许多用户在使用 PuTTY 软件时遇到的常见致命错误,如下所示:当软件在没有警告或保存其 state 的情况下抛出错误时发生致命错误,使用户无法执行任何操作额外的动作。

Resolution steps :解决步骤

Confirm Ip Address确认Ip地址

First things first, make sure the client machine can get to the remote server.首先,确保客户端计算机可以访问远程服务器。 A ping test is the most straightforward method for achieving this. ping 测试是实现此目的最直接的方法。 Pinging the server from the client will guarantee that the two devices have a valid.network connection.从客户端 ping 服务器将保证两个设备具有有效的网络连接。

Replace the IP address of the remote PC you want to SSH with the following cmdlet in the Command Prompt.在命令提示符中用以下cmdlet替换您想要的远程 PC 的 IP 地址 SSH。

If the ping does not produce a response, either the machine is not connected to your.network or the server's firewall is active, preventing both the ping and the SSH connection.如果 ping 没有产生响应,要么机器没有连接到您的网络,要么服务器的防火墙处于活动状态,阻止了 ping 和 SSH 连接。

Disable Windows Firewall禁用 Windows 防火墙

By default, Windows firewall blocks most ports.默认情况下,Windows 防火墙会阻止大多数端口。 Follow these steps to disable the firewall on your server by logging in through the portal or physically accessing the machine:按照以下步骤通过门户登录或物理访问计算机来禁用服务器上的防火墙:

1.In the Run Command box, type firewall.cpl to launch Windows Firewall. 1.在“运行命令”框中,键入 firewall.cpl 以启动 Windows 防火墙。

2.Now, from the left, select Turn Windows Defender Firewall on or off. 2.现在,从左侧开始,select 打开或关闭 Windows Defender 防火墙。

3.Now, under each of the visible.network profiles, select Turn off Windows Defender Firewall. 3.现在,在每个 visible.network 配置文件下,select 关闭 Windows Defender 防火墙。 To save the changes, click OK when finished.要保存更改,完成后单击确定。

Check once more to see if you can ping the client machine now.再次检查您现在是否可以 ping 客户端计算机。 If this is the case, then try the SSH connection once more to see if it works.如果是这种情况,请再次尝试 SSH 连接,看看它是否有效。 Continue implementing the following solutions to alleviate the issue if it still does not.如果问题仍然没有解决,请继续实施以下解决方案以缓解问题。

Check if SSH is Enabled检查SSH是否启用

1.Go to the following locations: 1.Go 到以下位置:

Settings app >> Apps >> Optional features

2.In front of the phrase "Add an optional feature," select View features. 2.在短语“添加可选功能”之前,select 查看功能。

3.Find "Open" in the "Add an optional feature" window. Select OpenSSH Server from the search results, and then click Next. 3.在搜索结果中的“添加可选功能”window、Select OpenSSH Server中找到“打开”,然后单击“下一步”。

4.Click Install in the following window. 4.点击下面window中的安装。

5.After that, the feature will be installed. 5.之后,将安装该功能。 The dependent services must be manually enabled when this occurs.发生这种情况时,必须手动启用从属服务。 In the Run Command box, type services.msc to open the Services console.在运行命令框中,键入 services.msc 以打开服务控制台。

6.To start the service, select Automatic from the "Startup type" drop-down menu in the Properties window and then click Start. 6.要启动该服务,select 自动从属性中的“启动类型”下拉菜单 window 然后单击启动。 To save the changes, click Apply and OK when it does.要保存更改,请单击“应用”,然后单击“确定”。

You should be able to use PuTTY to connect to this machine from the client computer now that SSH is set up.现在 SSH 已设置,您应该能够使用 PuTTY 从客户端计算机连接到这台机器。

Refer this doc also for more informa另请参阅此文档以获取更多信息

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

相关问题 尝试 ssh 进入 Google Cloud Platform VM 时出现错误公钥 - Error Public Key when trying to ssh into Google Cloud Platform VM 无法通过 SSH 连接到 Google Cloud VM 错误代码 4010 - Unable to connect to Google Cloud VM via SSH Error code 4010 无法通过 SSH 连接到 Google Cloud VM - Unable to connect to Google Cloud VM via SSH SSH 连接超时通过端口转发,但不是通过直接访问 - SSH connection timed out via port forwarding, but not via direct access 为什么在使用 Google Cloud 计算引擎时出现“RuntimeError:CUDA 错误:启动超时并被终止” - Why I get "RuntimeError: CUDA error: the launch timed out and was terminated" when using Google Cloud compute engine Upstream timed out error when deploying Docker Nginx FastAPI application on Google Cloud - Upstream timed out error when deploying Docker Nginx FastAPI application on Google Cloud Google Cloud 上的 Fedora SSH 连接问题 - Problem with Fedora SSH connection on Google Cloud Google Cloud Platform 中的 SSH 连接有问题 - Have problem with SSH connection in Google Cloud Platform 无法 SSH 进入我在 Google Cloud 上的 Compute Engine 虚拟机实例 - Unable to SSH into my Compute Engine VM instance on Google Cloud [Amazon](500150) 错误设置/关闭连接:连接超时 - [Amazon](500150) Error setting/closing connection: Connection timed out
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM