无法通过 VSCode 与远程服务器建立连接,但终端工作正常

问题描述 投票:0回答:1

我正在使用 VSCode 并尝试使用 VSCode 远程 SSH 扩展中的以下命令连接到远程服务器:“ssh -X [email protected]”。但是,VSCode 会抛出错误“无法建立与‘gadi.nci.org.au’的连接”。

有趣的是,当我尝试使用相同的命令通过终端连接到该服务器时,它工作得很好。此外,我使用相同的方法通过 VSCode 连接到其他服务器没有任何问题。

我使用Linux和Windows作为本地系统,都有这个问题。远程服务器是Linux。

我是编程初学者。有人遇到过类似的问题吗?关于可能导致这种差异的原因以及如何解决它有什么建议吗?

预先感谢您的协助!

这是输出

[00:38:05.726] Log Level: 2
[00:38:05.741] SSH Resolver called for "ssh-remote+gadi.nci.org.au", attempt 1
[00:38:05.742] "remote.SSH.useLocalServer": true
[00:38:05.743] "remote.SSH.path": undefined
[00:38:05.743] "remote.SSH.configFile": undefined
[00:38:05.743] "remote.SSH.useFlock": true
[00:38:05.743] "remote.SSH.lockfilesInTmp": false
[00:38:05.744] "remote.SSH.localServerDownload": auto
[00:38:05.744] "remote.SSH.remoteServerListenOnSocket": false
[00:38:05.744] "remote.SSH.showLoginTerminal": false
[00:38:05.744] "remote.SSH.defaultExtensions": []
[00:38:05.745] "remote.SSH.loglevel": 2
[00:38:05.745] "remote.SSH.enableDynamicForwarding": true
[00:38:05.745] "remote.SSH.enableRemoteCommand": false
[00:38:05.746] "remote.SSH.serverPickPortsFromRange": {}
[00:38:05.746] "remote.SSH.serverInstallPath": {}
[00:38:05.754] VS Code version: 1.81.1
[00:38:05.754] Remote-SSH version: [email protected]
[00:38:05.754] linux x64
[00:38:05.756] SSH Resolver called for host: gadi.nci.org.au
[00:38:05.756] Setting up SSH remote "gadi.nci.org.au"
[00:38:05.760] Acquiring local install lock: /tmp/vscode-remote-ssh-7b8c0aaa-install.lock
[00:38:05.763] Looking for existing server data file at /home/lu/.config/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-7b8c0aaa-6c3e3dba23e8fadc360aed75ce363ba185c49794-0.105.2023080715/data.json
[00:38:05.763] Using commit id "6c3e3dba23e8fadc360aed75ce363ba185c49794" and quality "stable" for server
[00:38:05.771] Install and start server if needed
[00:38:05.774] PATH: /usr/condabin:/usr/local/sbin:/usr/local/bin:/usr/bin:/home/lu/AMD:/opt/cuda/bin:/opt/cuda/nsight_compute:/opt/cuda/nsight_systems/bin:/home/lu/.dotnet/tools:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
[00:38:05.774] Checking ssh with "ssh -V"
[00:38:05.788] > OpenSSH_9.4p1, OpenSSL 3.1.2 1 Aug 2023

[00:38:05.794] askpass server listening on /run/user/1000/vscode-ssh-askpass-026934159dee6eab7dc05f0512243bea20c2e1e5.sock
[00:38:05.794] Spawning local server with {"serverId":1,"ipcHandlePath":"/run/user/1000/vscode-ssh-askpass-04cc79644a8074c9bf8655aea9e95d1462187b03.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","40853","-o","ConnectTimeout=15","gadi.nci.org.au"],"serverDataFolderName":".vscode-server","dataFilePath":"/home/lu/.config/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-7b8c0aaa-6c3e3dba23e8fadc360aed75ce363ba185c49794-0.105.2023080715/data.json"}
[00:38:05.794] Local server env: {"SHELL":"/bin/zsh","DISPLAY":":0","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/home/lu/.vscode/extensions/ms-vscode-remote.remote-ssh-0.105.2023080715/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/opt/visual-studio-code/code","VSCODE_SSH_ASKPASS_EXTRA_ARGS":"--ms-enable-electron-run-as-node","VSCODE_SSH_ASKPASS_MAIN":"/home/lu/.vscode/extensions/ms-vscode-remote.remote-ssh-0.105.2023080715/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/run/user/1000/vscode-ssh-askpass-026934159dee6eab7dc05f0512243bea20c2e1e5.sock"}
[00:38:05.800] Spawned 31026
[00:38:05.968] > local-server-1> Running ssh connection command: "-v -T -D 40853 -o ConnectTimeout=15 gadi.nci.org.au"
[00:38:05.974] > local-server-1> Spawned ssh, pid=31034
[00:38:05.979] stderr> OpenSSH_9.4p1, OpenSSL 3.1.2 1 Aug 2023
[00:38:06.081] stderr> debug1: Server host key: ssh-ed25519 SHA256:4VAftRK1D11TnXKVeWDsb/wonDJXW6p5Bt0J5XH4T+s
[00:38:06.298] Got askpass request: {"request":"[email protected]'s password:"}
[00:38:06.298] Showing password prompt
[00:38:06.299] Listening for interwindow password on /run/user/1000/vscode-ssh-askpass-64868002ff2f88c3f58f1a20a39d69c3efa9798b.sock
[00:38:06.299] Writing password prompt to globalState
[00:38:10.297] Got password response
[00:38:10.298] Interactor gave response: ********
[00:38:10.299] Cleaning up other-window auth server
[00:38:10.384] stderr> Authenticated to gadi.nci.org.au ([203.0.19.85]:22) using "password".
[00:38:10.905] > ###############################################################################
> #                  Welcome to the NCI National Facility!                      #
> #      This service is for authorised clients only. It is a criminal          #
> #      offence to:                                                            #
> #                - Obtain access to data without permission                   #
> #                - Damage, delete, alter or insert data without permission    #
> #      Use of this system requires acceptance of the Conditions of Use        #
> #      published at http://nci.org.au/users/nci-terms-and-conditions-access   #
> ###############################################################################
> |         gadi.nci.org.au - 260,760 processor InfiniBand x86_64 cluster       | 
> ===============================================================================
> 
> Oct 4 2022 Account Status Information on Login
>    Whenever logging in from outside of Gadi, all users will now be presented
>    with a brief summary about file expiry and projects near compute and/or
>    storage quotas. This can be configured using the "login-info-conf" utility.
>    For more information, please see https://opus.nci.org.au/x/HoABCw.
> 
> Mar 21 Sapphire Rapids Nodes Available
>    An expansion to the CPU capacity of Gadi is now available with the addition
>    of 720 Intel Xeon Sapphire Rapids nodes to Gadi. These nodes are available
>    in the "normalsr" and "expresssr" queues.
>    
>    For more information, please see https://opus.nci.org.au/x/gIDAD
> ===============================================================================
[00:38:11.422] > ready: 12b6d282c9b6
[00:38:11.433] > Linux 4.18.0-477.15.1.el8.nci.x86_64 #1 SMP Sun Jul 16 11:36:47 AEST 2023
[00:38:11.434] Platform: linux
[00:38:11.442] > /bin/bash
[00:38:11.442] Shell: bash
[00:38:11.443] Creating bash subshell inside "bash"
[00:38:11.500] > bash version:  4.4.20(1)-release
[00:38:11.509] > bash version:  4.4.20(1)-release
[00:38:11.532] > 12b6d282c9b6: running
[00:38:11.579] > Creating the server install dir failed...
> 12b6d282c9b6: start
> exitCode==34==
> listeningOn====
> osReleaseId====
> arch====
> vscodeArch====
> bitness====
> tmpDir==/run/user/15456==
> platform====
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime====
> 12b6d282c9b6: end
[00:38:11.580] Received install output: 
exitCode==34==
listeningOn====
osReleaseId====
arch====
vscodeArch====
bitness====
tmpDir==/run/user/15456==
platform====
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====

[00:38:11.582] Failed to parse remote port from server output
[00:38:11.582] Terminating local server
[00:38:11.591] Resolver error: Error: 
    at m.Create (/home/lu/.vscode/extensions/ms-vscode-remote.remote-ssh-0.105.2023080715/out/extension.js:2:617971)
    at t.handleInstallOutput (/home/lu/.vscode/extensions/ms-vscode-remote.remote-ssh-0.105.2023080715/out/extension.js:2:616531)
    at Object.e [as tryInstallWithLocalServer] (/home/lu/.vscode/extensions/ms-vscode-remote.remote-ssh-0.105.2023080715/out/extension.js:2:674803)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async /home/lu/.vscode/extensions/ms-vscode-remote.remote-ssh-0.105.2023080715/out/extension.js:2:696433
    at async t.withShowDetailsEvent (/home/lu/.vscode/extensions/ms-vscode-remote.remote-ssh-0.105.2023080715/out/extension.js:2:699849)
    at async /home/lu/.vscode/extensions/ms-vscode-remote.remote-ssh-0.105.2023080715/out/extension.js:2:673275
    at async C (/home/lu/.vscode/extensions/ms-vscode-remote.remote-ssh-0.105.2023080715/out/extension.js:2:669763)
    at async t.resolveWithLocalServer (/home/lu/.vscode/extensions/ms-vscode-remote.remote-ssh-0.105.2023080715/out/extension.js:2:672872)
    at async A (/home/lu/.vscode/extensions/ms-vscode-remote.remote-ssh-0.105.2023080715/out/extension.js:2:693642)
    at async t.resolve (/home/lu/.vscode/extensions/ms-vscode-remote.remote-ssh-0.105.2023080715/out/extension.js:2:697405)
    at async /home/lu/.vscode/extensions/ms-vscode-remote.remote-ssh-0.105.2023080715/out/extension.js:2:879896
[00:38:11.595] ------




[00:38:11.602] Local server exit: 15**strong text**
remote-server vscode-remote
1个回答
0
投票

我通过删除

.vscode-server
文件夹解决了这个问题。

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