使用vscode建立远程SSH失败

问题描述 投票:0回答:1
[10:42:13.122] Log Level: 2
[10:42:13.165] SSH Resolver called for "ssh-remote+66.29.137.58", attempt 1
[10:42:13.168] "remote.SSH.useLocalServer": false
[10:42:13.169] "remote.SSH.showLoginTerminal": false
[10:42:13.169] "remote.SSH.remotePlatform": {}
[10:42:13.170] "remote.SSH.path": undefined
[10:42:13.170] "remote.SSH.configFile": undefined
[10:42:13.171] "remote.SSH.useFlock": true
[10:42:13.171] "remote.SSH.lockfilesInTmp": false
[10:42:13.172] "remote.SSH.localServerDownload": auto
[10:42:13.173] "remote.SSH.remoteServerListenOnSocket": false
[10:42:13.173] "remote.SSH.showLoginTerminal": false
[10:42:13.173] "remote.SSH.defaultExtensions": []
[10:42:13.174] "remote.SSH.loglevel": 2
[10:42:13.178] "remote.SSH.enableDynamicForwarding": true
[10:42:13.179] "remote.SSH.enableRemoteCommand": false
[10:42:13.179] "remote.SSH.serverPickPortsFromRange": {}
[10:42:13.180] "remote.SSH.serverInstallPath": {}
[10:42:13.198] VS Code version: 1.81.1
[10:42:13.199] Remote-SSH version: [email protected]
[10:42:13.199] win32 x64
[10:42:13.203] SSH Resolver called for host: 66.29.137.58
[10:42:13.203] Setting up SSH remote "66.29.137.58"
[10:42:13.220] Using commit id "6c3e3dba23e8fadc360aed75ce363ba185c49794" and quality "stable" for server
[10:42:13.234] Install and start server if needed
[10:43:08.410] Checking ssh with "C:\Program Files (x86)\Common Files\Oracle\Java\javapath\ssh.exe -V"
[10:43:08.419] Got error from ssh: spawn C:\Program Files (x86)\Common Files\Oracle\Java\javapath\ssh.exe ENOENT
[10:43:08.420] Checking ssh with "C:\WINDOWS\system32\ssh.exe -V"
[10:43:08.424] Got error from ssh: spawn C:\WINDOWS\system32\ssh.exe ENOENT
[10:43:08.425] Checking ssh with "C:\WINDOWS\ssh.exe -V"
[10:43:08.428] Got error from ssh: spawn C:\WINDOWS\ssh.exe ENOENT
[10:43:08.429] Checking ssh with "C:\WINDOWS\System32\Wbem\ssh.exe -V"
[10:43:08.432] Got error from ssh: spawn C:\WINDOWS\System32\Wbem\ssh.exe ENOENT
[10:43:08.434] Checking ssh with "C:\WINDOWS\System32\WindowsPowerShell\v1.0\ssh.exe -V"
[10:43:08.437] Got error from ssh: spawn C:\WINDOWS\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT
[10:43:08.438] Checking ssh with "C:\WINDOWS\System32\OpenSSH\ssh.exe -V"
[10:43:08.524] > OpenSSH_for_Windows_8.6p1, LibreSSL 3.4.3

[10:43:08.536] Remote command length: 6211/8192 characters
[10:43:08.537] Running script with connection command: "C:\WINDOWS\System32\OpenSSH\ssh.exe" -T -D 50112 "66.29.137.58" powershell
[10:43:08.546] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[10:43:30.044] > ssh: connect to host 66.29.137.58 port 22: Connection timed out
> The process tried to write to a nonexistent pipe.
> ]0;C:\WINDOWS\System32\cmd.exe
[10:43:30.045] Got some output, clearing connection timeout
[10:43:31.338] "install" terminal command done
[10:43:31.339] Install terminal quit with output: ]0;C:\WINDOWS\System32\cmd.exe
[10:43:31.340] Received install output: ]0;C:\WINDOWS\System32\cmd.exe
[10:43:31.342] Failed to parse remote port from server output
[10:43:31.347] Resolver error: Error: 
    at m.Create (c:\Users\haiqa\.vscode\extensions\ms-vscode-remote.remote-ssh-0.102.0\out\extension.js:1:584145)
    at t.handleInstallOutput (c:\Users\haiqa\.vscode\extensions\ms-vscode-remote.remote-ssh-0.102.0\out\extension.js:1:582705)
    at t.tryInstall (c:\Users\haiqa\.vscode\extensions\ms-vscode-remote.remote-ssh-0.102.0\out\extension.js:1:681881)
    at async c:\Users\haiqa\.vscode\extensions\ms-vscode-remote.remote-ssh-0.102.0\out\extension.js:1:644110
    at async t.withShowDetailsEvent (c:\Users\haiqa\.vscode\extensions\ms-vscode-remote.remote-ssh-0.102.0\out\extension.js:1:647428)
    at async t.resolve (c:\Users\haiqa\.vscode\extensions\ms-vscode-remote.remote-ssh-0.102.0\out\extension.js:1:645160)
    at async c:\Users\haiqa\.vscode\extensions\ms-vscode-remote.remote-ssh-0.102.0\out\extension.js:1:720916
[10:43:31.368] ------

尝试过的解决方案

  • 确保在托管网站 (CPanel) 上启用 SSH。
  • 通过旧线程的 vscode 终端尝试了
    Kill VS Code Server on Host
  • 尝试自定义配置的绝对文件路径尝试的解决方案
  • 确保我在服务器端和客户端都安装了 OpenSSH Windows OpenSSH
visual-studio-code remote-access vscode-remote-ssh
1个回答
0
投票

从日志中,这是相关的错误:

ssh: connect to host 66.29.137.58 port 22: Connection timed out

这意味着网络流量无法在您的计算机和该 IP 地址之间传输。可能是服务器端的防火墙。可能是本地防火墙阻止端口 22 上的流量流出。

© www.soinside.com 2019 - 2024. All rights reserved.