What Do I Do If Error Message "ssh: connect to host ModelArts-xxx port xxx: Connection timed out" Is Displayed?
Symptom
When connecting to a notebook instance via SSH, the following error message occurs:
ssh: connect to host ModelArts-xxx port xxx: Connection timed out

Possible Cause
The network connection is unreachable when attempting to access the cloud notebook instance via SSH. In most scenarios, this issue is triggered by the security configurations of your local network environment.
Solution
Perform the following steps to troubleshoot:
- Direct SSH troubleshooting VS Code's Remote-SSH extension essentially calls your local SSH client.
- Open a terminal on the node where VS Code is running (such as PowerShell, CMD, or Git Bash on Windows).
- Use SSH to connect to the notebook instance. For details about how to connect to an instance using SSH, see Using a Notebook Instance Remotely with SSH.
- If the direct SSH connection fails: This indicates a fundamental network connectivity issue. For details, see Accessing a Notebook Instance Using SSH for Troubleshooting.
- If the direct SSH connection succeeds but VS Code still times out: Proceed to the specialized VS Code troubleshooting steps below.
- Specialized VS Code troubleshooting
- Connection timeout value is too short VS Code's default connection timeout limit might be insufficient, particularly in high-latency network environments.
- You can resolve this by editing your SSH configuration file:
- Linux or macOS: Edit the ~/.ssh/config file.
- Windows: Edit the C:\Users\<Your_Username>\.ssh\config file.
- Add the following configurations for your host:
Host <Your_Host_Alias> HostName <Actual_IP> User <Username> Port <Port> ConnectTimeout 30 ServerAliveInterval 60 ServerAliveCountMax 3 - Save the file and reconnect to the notebook instance.
- You can resolve this by editing your SSH configuration file:
- VS Code freezes when executing remote commands Once connected to the notebook instance, VS Code runs a sequence of scripts to perform tasks like installing and starting the VS Code Server. If the notebook instance lacks internet access to download the VS Code Server, or if script execution takes too long, a "timed out" error will trigger. You can resolve this by manually installing the VS Code Server:
- Download the matching VS Code Server package onto your local machine.
- Disable automatic server downloads in your local VS Code settings by setting Remote.SSH: Allow Local Server Download to false.
- Manually install the VS Code Server package inside the notebook instance, then try reconnecting.
- Connection timeout value is too short
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot