如何解决 Vscode ssh 无法与 "hostname" 建立连接的问题?

How to troubleshoot Vscode ssh could not establish connection to "hostname"?

我正在尝试使用 Vscode ssh 连接到主机,但我一直收到“无法与 'hostname' 建立连接”的提示。

我很困惑,因为它工作得很好,然后突然停止工作了。

我没有在 vscode

中更改主机名或与 ssh 相关的任何配置

我仍然可以在 PuTTY 中连接到主机,但我想使用 vscode

输出:

[13:55:52.602] Log Level: 2
[13:55:52.604] remote-ssh@0.76.1
[13:55:52.604] win32 x64
[13:55:52.617] SSH Resolver called for "ssh-remote+ug09.cs.ualberta.ca", attempt 1
[13:55:52.617] "remote.SSH.useLocalServer": false
[13:55:52.618] "remote.SSH.showLoginTerminal": false
[13:55:52.618] "remote.SSH.remotePlatform": {"ug03.cs.ualberta.ca":"linux","ug09.cs.ualberta.ca":"linux","uf23.cs.ualberta.ca":"linux"}
[13:55:52.618] "remote.SSH.path": undefined
[13:55:52.618] "remote.SSH.configFile": undefined
[13:55:52.618] "remote.SSH.useFlock": true
[13:55:52.618] "remote.SSH.lockfilesInTmp": false
[13:55:52.619] "remote.SSH.localServerDownload": auto
[13:55:52.619] "remote.SSH.remoteServerListenOnSocket": false
[13:55:52.619] "remote.SSH.showLoginTerminal": false
[13:55:52.619] "remote.SSH.defaultExtensions": []
[13:55:52.619] "remote.SSH.loglevel": 2
[13:55:52.619] "remote.SSH.enableDynamicForwarding": true
[13:55:52.619] "remote.SSH.enableRemoteCommand": false
[13:55:52.620] "remote.SSH.serverPickPortsFromRange": {}
[13:55:52.620] "remote.SSH.serverInstallPath": {}
[13:55:52.645] SSH Resolver called for host: ug09.cs.ualberta.ca
[13:55:52.646] Setting up SSH remote "ug09.cs.ualberta.ca"
[13:55:52.668] Using commit id "8908a9ca0f221f36507231afb39d2d8d1e182702" and quality "stable" for server
[13:55:52.672] Install and start server if needed
[13:55:52.676] Checking ssh with "ssh -V"
[13:55:52.729] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5

[13:55:52.734] Running script with connection command: ssh -T -D 62422 "ug09.cs.ualberta.ca" bash
[13:55:52.737] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[13:55:52.985] > 
> 
> ]0;C:\WINDOWS\System32\cmd.exe
[13:55:52.985] Got some output, clearing connection timeout
[13:55:53.000] > 
> 
[13:55:53.256] > abujayya@ug09.cs.ualberta.ca's password: 
[13:55:53.257] Showing password prompt
[13:55:57.151] Got password response
[13:55:57.151] "install" wrote data to terminal: "**********"
[13:55:57.318] > 
> 
[13:55:58.213] > 7037813af524: running
> 
[13:55:58.239] > mkdir: cannot create directory ‘/cshome/abujayya/.vscode-server/bin/8908a9ca0f22
> 1f36507231afb39d2d8d1e182702’: Disk quota exceeded
> Creating the server install dir failed...
> 7037813af524: start
> exitCode==34==
> listeningOn====
> osReleaseId====
> arch====
> tmpDir==/tmp==
> platform====
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime====
> 7037813af524: end
> 
[13:55:58.239] Received install output: 
exitCode==34==
listeningOn====
osReleaseId====
arch====
tmpDir==/tmp==
platform====
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====

[13:55:58.240] Failed to parse remote port from server output
[13:55:58.241] Resolver error: Error: 
    at Function.Create (c:\Users\Mahmoud\.vscode\extensions\ms-vscode-remote.remote-ssh-0.76.1\out\extension.js:1:586041)
    at Object.t.handleInstallOutput (c:\Users\Mahmoud\.vscode\extensions\ms-vscode-remote.remote-ssh-0.76.1\out\extension.js:1:584693)
    at Object.t.tryInstall (c:\Users\Mahmoud\.vscode\extensions\ms-vscode-remote.remote-ssh-0.76.1\out\extension.js:1:681846)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async c:\Users\Mahmoud\.vscode\extensions\ms-vscode-remote.remote-ssh-0.76.1\out\extension.js:1:644486
    at async Object.t.withShowDetailsEvent (c:\Users\Mahmoud\.vscode\extensions\ms-vscode-remote.remote-ssh-0.76.1\out\extension.js:1:647831)
    at async Object.t.resolve (c:\Users\Mahmoud\.vscode\extensions\ms-vscode-remote.remote-ssh-0.76.1\out\extension.js:1:645565)
    at async c:\Users\Mahmoud\.vscode\extensions\ms-vscode-remote.remote-ssh-0.76.1\out\extension.js:1:722872
[13:55:58.245] ------




[13:55:59.490] "install" terminal command done
[13:55:59.491] Install terminal quit with output: 
[13:56:29.738] ConfigFileWatcher: start watching file:///c%3A/Users/Mahmoud/.ssh/config
[13:56:29.738] ConfigFileWatcher: adding save listener
[13:56:29.738] ConfigFileWatcher: adding close listener
[14:00:32.552] Picking SSH host
[14:00:33.624] Selected ug04.cs.ualberta.ca

如何解决此问题?

原来是因为远程机器的磁盘配额超出了。在我释放远程计算机中的一些 space 后,此问题已修复。