远程 - SSH 未连接到 VSCode 中的远程 Linux 服务器?

时间:2021-03-07 03:37:41

标签: linux visual-studio-code ssh

当我尝试通过 VSCode 连接到远程 Linux 服务器时,我遇到了这个问题。我不熟悉 ssh,所以我不知道发生了什么。有谁知道如何解决这一问题?我在 Mac 上使用 Homebrew 安装了 VSCode 和 OpenSSH。当我通过终端连接时它工作正常。每次我尝试通过 VSCode 登录时,终端都会告诉我登录尝试失败。

.ssh/config:

Host linux.ews.illinois.edu
  HostName linux.ews.illinois.edu
  user nconner2

终端消息:

[21:23:47.637] remote-ssh@0.65.1
[21:23:47.637] darwin x64
[21:23:47.638] SSH Resolver called for "ssh-remote+linux.ews.illinois.edu", attempt 1
[21:23:47.638] "remote.SSH.useLocalServer": true
[21:23:47.638] "remote.SSH.sshPath": undefined
[21:23:47.639] "remote.SSH.sshConfigurationFile": undefined
[21:23:47.639] "remote.SSH.useFlock": true
[21:23:47.639] "remote.SSH.lockfilesInTmp": false
[21:23:47.639] "remote.SSH.localServerDownload": auto
[21:23:47.639] "remote.SSH.remoteServerListenOnSocket": false
[21:23:47.639] "remote.SSH.showLoginTerminal": true
[21:23:47.639] "remote.SSH.defaultExtensions": []
[21:23:47.639] SSH Resolver called for host: linux.ews.illinois.edu
[21:23:47.639] Setting up SSH remote "linux.ews.illinois.edu"
[21:23:47.641] Acquiring local install lock: /var/folders/fh/5nwdtjtn4_56hpzl0qyyw2sh0000gn/T/vscode-remote-ssh-linux.ews.illinois.edu-install.lock
[21:23:47.660] Looking for existing server data file at /Users/noahconner/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-linux.ews.illinois.edu-f30a9b73e8ffc278e71575118b6bf568f04587c8-0.65.1/data.json
[21:23:47.661] Using commit id "f30a9b73e8ffc278e71575118b6bf568f04587c8" and quality "stable" for server
[21:23:47.664] Install and start server if needed
[21:23:47.666] Checking ssh with "ssh -V"
[21:23:47.675] > OpenSSH_8.5p1, OpenSSL 1.1.1j  16 Feb 2021

[21:23:47.678] askpass server listening on /var/folders/fh/5nwdtjtn4_56hpzl0qyyw2sh0000gn/T/vscode-ssh-askpass-f56f2612e828c61e475d6064aa0d78032a26fbfd.sock
[21:23:47.679] Spawning local server with {"ipcHandlePath":"/var/folders/fh/5nwdtjtn4_56hpzl0qyyw2sh0000gn/T/vscode-ssh-askpass-812c67b3bcc59d17218e7815bc01d66ff6cdc2f1.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","59712","-o","ConnectTimeout=15","linux.ews.illinois.edu"],"dataFilePath":"/Users/noahconner/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-linux.ews.illinois.edu-f30a9b73e8ffc278e71575118b6bf568f04587c8-0.65.1/data.json"}
[21:23:47.679] Local server env: {"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/noahconner/.vscode/extensions/ms-vscode-remote.remote-ssh-0.65.1/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Renderer).app/Contents/MacOS/Code Helper (Renderer)","VSCODE_SSH_ASKPASS_MAIN":"/Users/noahconner/.vscode/extensions/ms-vscode-remote.remote-ssh-0.65.1/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/fh/5nwdtjtn4_56hpzl0qyyw2sh0000gn/T/vscode-ssh-askpass-f56f2612e828c61e475d6064aa0d78032a26fbfd.sock"}
[21:23:47.679] Spawned 63485
[21:23:47.770] > local-server> Spawned ssh: 63486
[21:23:47.776] stderr> OpenSSH_8.5p1, OpenSSL 1.1.1j  16 Feb 2021
[21:23:48.341] stderr> debug1: Server host key: ssh-ed25519 SHA256:2VRwMXjWIRpjcnMJhM7fVpH14MUFgw61vpABi0mEaYo
[21:23:49.214] Got askpass request: {"request":"nconner2@linux.ews.illinois.edu's password:"}
[21:23:49.214] Showing password prompt
[21:23:49.215] Listening for interwindow password on /var/folders/fh/5nwdtjtn4_56hpzl0qyyw2sh0000gn/T/vscode-ssh-askpass-69bedf1149b63f482381255a6068bb97fe17bd67.sock
[21:23:49.215] Writing password prompt to globalState
[21:23:54.263] Got password response
[21:23:54.263] Interactor gave response: *************
[21:23:54.264] Cleaning up other-window auth server
[21:23:54.381] stderr> Authenticated to linux.ews.illinois.edu ([128.174.11.96]:22).
[21:23:55.409] > ready: 68f663324481
[21:23:55.410] stderr> stdin: is not a tty
[21:23:55.432] > Linux 3.10.0-1160.6.1.el7.x86_64 #1 SMP Tue Nov 17 13:59:11 UTC 2020
[21:23:55.432] Platform: linux
[21:23:55.494] > 68f663324481: running
[21:23:55.562] > Acquiring lock on /home/nconner2/.vscode-server/bin/f30a9b73e8ffc278e71575118b6bf568f04587c8/vscode-remote-lock.nconner2.f30a9b73e8ffc278e71575118b6bf568f04587c8
[21:23:55.576] > Installing to /home/nconner2/.vscode-server/bin/f30a9b73e8ffc278e71575118b6bf568f04587c8...
[21:23:55.582] > 68f663324481%%1%%
[21:23:55.587] > Downloading with wget
[21:23:56.539] > Download complete
[21:23:56.539] > 68f663324481%%2%%
> tar --version:
> tar (GNU tar) 1.26
> Copyright (C) 2011 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://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.
[21:23:57.435] stderr> bash: line 412:  8991 Terminated              tar -xf vscode-server.tar.gz
[21:23:57.465] stderr> mv: cannot move ‘vscode-server-linux-x64/bin’ to ‘./bin’: File exists
[21:23:57.470] stderr> mv: cannot move ‘vscode-server-linux-x64/node_modules’ to ‘./node_modules’: File exists
[21:23:57.475] > ERROR: /home/nconner2/.vscode-server/bin/f30a9b73e8ffc278e71575118b6bf568f04587c8/node or /home/nconner2/.vscode-server/bin/f30a9b73e8ffc278e71575118b6bf568f04587c8/server.sh don't exist
> Trigger local server download
> 68f663324481:trigger_server_download
> platform==linux==
> vscodeArch==x64==
> destFolder==/home/nconner2/.vscode-server/bin/f30a9b73e8ffc278e71575118b6bf568f04587c8==
[21:23:57.476] > 68f663324481:trigger_server_download_end
> Waiting for client to transfer server archive...
> Waiting for /home/nconner2/.vscode-server/bin/f30a9b73e8ffc278e71575118b6bf568f04587c8/vscode-scp-done.flag and vscode-server.tar.gz to exist
>  
[21:23:57.476] Got request to download on client for {"platform":"linux","arch":"x64","destFolder":"/home/nconner2/.vscode-server/bin/f30a9b73e8ffc278e71575118b6bf568f04587c8"}
[21:23:57.477] Downloading VS Code server locally...
[21:23:58.015] Downloaded VS Code server to /var/folders/fh/5nwdtjtn4_56hpzl0qyyw2sh0000gn/T/491c47c1-339c-4324-8531-dede113cb7e4
[21:23:58.017] Renamed VS Code server to /var/folders/fh/5nwdtjtn4_56hpzl0qyyw2sh0000gn/T/vscode_server_1615087438015/vscode-server.tar.gz
[21:23:58.019] Checking ssh with "ssh -V"
[21:23:58.028] > OpenSSH_8.5p1, OpenSSL 1.1.1j  16 Feb 2021

[21:23:58.029] Testing scp with "scp"
[21:23:58.037] scp exited with code: 1
[21:23:58.037] 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
[21:23:58.037] Copying file to remote with scp -o ConnectTimeout=15 'vscode-server.tar.gz' 'vscode-scp-done.flag' 'linux.ews.illinois.edu':'/home/nconner2/.vscode-server/bin/f30a9b73e8ffc278e71575118b6bf568f04587c8'
[21:23:58.037] Using cwd: file:///var/folders/fh/5nwdtjtn4_56hpzl0qyyw2sh0000gn/T/vscode_server_1615087438015
[21:23:58.709] > nconner2@linux.ews.illinois.edu's password: 
[21:24:04.778] > 
[21:24:05.961] > stdin: is not a tty
[21:24:05.979] > vscode-server.tar.gz                                                                                                                   0%    0     0.0KB/s   --:-- ETA
[21:24:07.008] > vscode-server.tar.gz                                                                                                                  13% 4112KB   3.9MB/s   00:06 ETA
[21:24:07.784] > lost connection
[21:24:08.042] "Copy server to host" terminal command done```

0 个答案:

没有答案