首页 > 解决方案 > 带有本地服务器下载的远程 SSH 不起作用

问题描述

我正在尝试通过 Windows 上的 VSCode 中的远程 ssh 访问基于 linux 的服务器。SSH 连接本身可以工作。由于 remote-linux-server 除了 SSH 之外没有外部连接,我尝试通过我设置为 always 的“remote.SSH.localServerDownload”选项安装 VSCode-Server。日志显示,服务器仍然想要访问 curl 和 wget(显然失败了)。一周前它还在工作,但遗憾的是我不记得那次我做了什么不同。我尝试删除 VSCode 文件夹。

[13:32:44.770] Log Level: 2
[13:32:44.774] remote-ssh@0.65.4
[13:32:44.774] win32 x64
[13:32:44.774] SSH Resolver called for "ssh-remote+HOST", attempt 1
[13:32:44.774] "remote.SSH.useLocalServer": true
[13:32:44.775] "remote.SSH.path": undefined
[13:32:44.775] "remote.SSH.configFile": undefined
[13:32:44.775] "remote.SSH.useFlock": true
[13:32:44.775] "remote.SSH.lockfilesInTmp": false
[13:32:44.775] "remote.SSH.localServerDownload": always
[13:32:44.775] "remote.SSH.remoteServerListenOnSocket": false
[13:32:44.775] "remote.SSH.showLoginTerminal": false
[13:32:44.775] "remote.SSH.defaultExtensions": []
[13:32:44.775] "remote.SSH.loglevel": 2
[13:32:44.776] SSH Resolver called for host: HOST
[13:32:44.776] Setting up SSH remote "HOST"
[13:32:44.778] Acquiring local install lock: C:\Users\MK\AppData\Local\Temp\vscode-remote-ssh-HOST-install.lock
[13:32:44.788] Looking for existing server data file at c:\Users\MK\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-ssh\vscode-ssh-host-HOST-3c4e3df9e89829dce27b7b5c24508306b151f30d-0.65.4\data.json
[13:32:44.789] Using commit id "3c4e3df9e89829dce27b7b5c24508306b151f30d" and quality "stable" for server
[13:32:44.791] Install and start server if needed
[13:32:44.807] Checking ssh with "ssh -V"
[13:32:44.829] > OpenSSH_for_Windows_8.1p1, 
[13:32:44.829] > LibreSSL 3.0.2

[13:32:44.830] Checking ssh with "C:\WINDOWS\System32\OpenSSH\ssh.exe -V"
[13:32:44.850] > OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2

[13:32:44.851] Checking ssh with "C:\Program Files\Git\usr\bin\ssh.exe -V"
[13:32:44.982] > OpenSSH_8.5p1, OpenSSL 1.1.1k  25 Mar 2021

[13:32:44.984] Using SSH config file "C:\Users\MK\.ssh\config"
[13:32:44.985] askpass server listening on \\.\pipe\vscode-ssh-askpass-8ad633ad83ad1df14e5f98e3c4a53a41ab15831e-sock
[13:32:44.985] Spawning local server with {"ipcHandlePath":"\\\\.\\pipe\\vscode-ssh-askpass-1b2a56c5214aacdb265183976eadc60fca876523-sock","sshCommand":"C:\\Program Files\\Git\\usr\\bin\\ssh.exe","sshArgs":["-v","-T","-D","52248","-F","C:\\Users\\MK\\.ssh\\config","HOST","bash"],"dataFilePath":"c:\\Users\\MK\\AppData\\Roaming\\Code\\User\\globalStorage\\ms-vscode-remote.remote-ssh\\vscode-ssh-host-HOST-3c4e3df9e89829dce27b7b5c24508306b151f30d-0.65.4\\data.json"}
[13:32:44.985] Local server env: {"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"c:\\Users\\MK\\.vscode\\extensions\\ms-vscode-remote.remote-ssh-0.65.4\\out\\local-server\\askpass.bat","VSCODE_SSH_ASKPASS_NODE":"C:\\Program Files\\Microsoft VS Code\\Code.exe","VSCODE_SSH_ASKPASS_MAIN":"c:\\Users\\MK\\.vscode\\extensions\\ms-vscode-remote.remote-ssh-0.65.4\\out\\askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"\\\\.\\pipe\\vscode-ssh-askpass-8ad633ad83ad1df14e5f98e3c4a53a41ab15831e-sock"}
[13:32:44.992] Spawned 22340
[13:32:45.056] > local-server> Spawned ssh: 3668
[13:32:45.075] stderr> OpenSSH_8.5p1, OpenSSL 1.1.1k  25 Mar 2021
[13:32:45.217] stderr> debug1: Server host key: ssh-ed25519 SHA256:/1t/JqisQD0nDklqpUMYu72adsk8OIc1vZsHJSa9bLg
[13:32:45.361] stderr> Authenticated to HOST ([IP]:22).
[13:32:45.466] > ready: b992cf3429fd
[13:32:45.499] > Linux 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19)
[13:32:45.499] Platform: linux
[13:32:45.547] > b992cf3429fd: running
[13:32:45.576] > Acquiring lock on /home/USER/.vscode-server/bin/3c4e3df9e89829dce27b7b5c24508306b151f30d/vscode-remote-lock.USER.3c4e3df9e89829dce27b7b5c24508306b151f30d
[13:32:45.581] > Installing to /home/USER/.vscode-server/bin/3c4e3df9e89829dce27b7b5c24508306b151f30d...
[13:32:45.581] > Trigger local server download
> b992cf3429fd:trigger_server_download
> platform==linux==
> vscodeArch==x64==
> destFolder==/home/USER/.vscode-server/bin/3c4e3df9e89829dce27b7b5c24508306b151f30d==
> b992cf3429fd:trigger_server_download_end
> Waiting for client to transfer server archive...
> Waiting for /home/USER/.vscode-server/bin/3c4e3df9e89829dce27b7b5c24508306b151f30d/vscode-scp-done.flag and vscode-server.tar.gz to exist
>  
[13:32:45.582] Got request to download on client for {"platform":"linux","arch":"x64","destFolder":"/home/USER/.vscode-server/bin/3c4e3df9e89829dce27b7b5c24508306b151f30d"}
[13:32:45.582] Downloading VS Code server locally...
[13:32:45.810] Downloaded VS Code server to c:\Users\MK\AppData\Local\Temp\cd45ddac-0bae-44e0-b54a-86882debe561
[13:32:45.811] Renamed VS Code server to c:\Users\MK\AppData\Local\Temp\vscode_server_1619436765810\vscode-server.tar.gz
[13:32:45.812] Checking ssh with "ssh -V"
[13:32:45.832] > OpenSSH_for_Windows_8.1p1,
[13:32:45.832] >  LibreSSL 3.0.2

[13:32:45.834] Checking ssh with "C:\WINDOWS\System32\OpenSSH\ssh.exe -V"
[13:32:45.853] > OpenSSH_for_Windows_8.1p1, LibreSSL 3.0
[13:32:45.853] > .2

[13:32:45.855] Checking ssh with "C:\Program Files\Git\usr\bin\ssh.exe -V"
[13:32:45.876] > OpenSSH_8.5p1, OpenSSL 1.1.1k  25 Mar 2021

[13:32:45.878] Expecting scp to be next to ssh at C:\Program Files\Git\usr\bin\scp.exe
[13:32:45.878] Testing scp with "C:\Program Files\Git\usr\bin\scp.exe"
[13:32:45.914] scp exited with code: 1
[13:32:45.914] Got stderr from scp: usage: scp [-346ABCpqrTv] [-c cipher] [-F ssh_config] [-i identity_file]
            [-J destination] [-l limit] [-o ssh_option] [-P port]
            [-S program] source ... target
[13:32:45.915] Using SSH config file "C:\Users\MK\.ssh\config"
[13:32:45.915] Copying file to remote with "C:\Program Files\Git\usr\bin\scp.exe" -F "C:\Users\MK\.ssh\config" "vscode-server.tar.gz" "vscode-scp-done.flag" "HOST":"/home/USER/.vscode-server/bin/3c4e3df9e89829dce27b7b5c24508306b151f30d"
[13:32:45.915] Using cwd: file:///c%3A/Users/MK/AppData/Local/Temp/vscode_server_1619436765810
[13:32:45.915] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[13:32:46.382] > vscode-server.tar.gz                            0%    0     0.0KB/s   --:-- ETA]0;C:\WINDOWS\System32\cmd.exe
[13:32:47.384] > vscode-server.tar.gz                           19% 6144KB   6.0MB/s   00:04 ETA
[13:32:48.385] > vscode-server.tar.gz                           34%   10MB   5.8MB/s   00:03 ETA
[13:32:49.407] > vscode-server.tar.gz                           48%   15MB   5.7MB/s   00:02 ETA
[13:32:50.411] > vscode-server.tar.gz                           62%   19MB   5.5MB/s   00:02 ETA
[13:32:51.400] > vscode-server.tar.gz                           76%   23MB   5.4MB/s   00:01 ETA
[13:32:52.413] > vscode-server.tar.gz                           90%   27MB   5.3MB/s   00:00 ETA
[13:32:53.582] > vscode-server.tar.gz                          100%   30MB   4.2MB/s   00:07    
[13:32:53.602] > 
> vscode-scp-done.flag                            0%    0     0.0KB/s   --:-- ETA
[13:32:53.634] > vscode-scp-done.flag                          100%    9     0.3KB/s   00:00    
[13:32:53.649] > 
[13:32:53.952] "Copy server to host" terminal command done
[13:32:54.586] > Found flag and server on host
[13:32:54.589] > b992cf3429fd%%2%%
> tar --version:
[13:32:54.591] > tar (GNU tar) 1.30
> Copyright (C) 2017 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> 
> Written by John Gilmore and Jay Fenlason.
[13:32:55.257] > Checking /home/USER/.vscode-server/.3c4e3df9e89829dce27b7b5c24508306b151f30d.log and /home/USER/.vscode-server/.3c4e3df9e89829dce27b7b5c24508306b151f30d.pid for a running server
[13:32:55.265] > WARNING: VS Code Server is running but its logfile is missing. Don't delete the VS Code Server manually, run the command 'Uninstall VS Code Server'.
> Starting server with command... /home/USER/.vscode-server/bin/3c4e3df9e89829dce27b7b5c24508306b151f30d/server.sh --start-server --host=127.0.0.1 --enable-remote-auto-shutdown  --port=0  &> "/home/USER/.vscode-server/.3c4e3df9e89829dce27b7b5c24508306b151f30d.log" < /dev/null
> printenv:
[13:32:55.268] >     SHELL=/bin/bash
>     PWD=/home/USER
>     LOGNAME=USER
>     HOME=/home/USER
>     VSCODE_AGENT_FOLDER=/home/USER/.vscode-server
>     SSH_CONNECTION=84.146.181.54 52251 129.217.29.87 22
>     USER=USER
>     SHLVL=1
>     SSH_CLIENT=84.146.181.54 52251 22
>     PATH=/usr/local/bin:/usr/bin:/bin:/usr/games
>     MAIL=/var/mail/USER
>     OLDPWD=/home/USER/.vscode-server/bin/3c4e3df9e89829dce27b7b5c24508306b151f30d
>     _=/usr/bin/printenv
[13:32:55.272] stderr> rm: cannot remove '/home/USER/.vscode-server/.3c4e3df9e89829dce27b7b5c24508306b151f30d.token': No such file or directory
[13:32:55.304] > Spawned remote server: 36699
[13:32:55.308] > Waiting for server log...
[13:32:55.345] > Waiting for server log...
[13:32:55.382] >  
> *
> * Reminder: You may only use this software with Visual Studio family products,
> * as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
> *
>  
[13:32:55.391] > Neither wget nor curl is installed
> b992cf3429fd: start
> exitCode==26==
[13:32:55.391] > listeningOn==45739==
> osReleaseId==debian==
> arch==x86_64==
> tmpDir==/tmp==
> platform==linux==
> unpackResult==success==
> didLocalDownload==1==
> downloadTime====
> installTime==655==
> extInstallTime====
> serverStartTime==111==
[13:32:55.391] > b992cf3429fd: end
[13:32:55.392] Received install output: 
exitCode==26==listeningOn==45739==
osReleaseId==debian==
arch==x86_64==
tmpDir==/tmp==
platform==linux==
unpackResult==success==
didLocalDownload==1==
downloadTime====
installTime==655==
extInstallTime====
serverStartTime==111==
[13:32:55.392] Neither curl nor wget is installed - can't download the Server
[13:32:55.392] Terminating local server
[13:32:55.395] Resolver error: Error: Downloading VS Code Server failed - please install either curl or wget on the remote.
    at Function.ServerInstallError (c:\Users\MK\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.4\out\extension.js:1:64575)
    at c (c:\Users\MK\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.4\out\extension.js:1:57894)
    at Object.t.handleInstallOutput (c:\Users\MK\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.4\out\extension.js:1:63317)
    at Object.e [as tryInstallWithLocalServer] (c:\Users\MK\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.4\out\extension.js:1:386419)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async c:\Users\MK\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.4\out\extension.js:1:294035
    at async Object.t.withShowDetailsEvent (c:\Users\MK\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.4\out\extension.js:1:405329)
    at async c:\Users\MK\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.4\out\extension.js:1:384890
    at async E (c:\Users\MK\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.4\out\extension.js:1:381658)
    at async Object.t.resolveWithLocalServer (c:\Users\MK\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.4\out\extension.js:1:384517)
    at async Object.t.resolve (c:\Users\MK\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.4\out\extension.js:1:295505)
    at async c:\Users\MK\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.4\out\extension.js:127:110530
[13:32:55.398] ------




[13:32:55.399] Local server exit: null

我究竟做错了什么?我真的很想让这个工作,因为一旦它工作,这是一个非常好的工作环境。

此致

曼努埃尔

标签: linuxvisual-studio-codesshremote-access

解决方案


推荐阅读