简体   繁体   English

通过 VSCode Remote SSH 连接到 ec2 实例时出错

[英]Error while Connecting to a ec2 instance through VSCode Remote SSH

I have tried to connect to my amazon instance through SSH before through a program called Bitvise SSH, but today I found out there is a way to directly connect to my instance through a function in VSCode.我曾尝试通过 SSH 连接到我的亚马逊实例,之前通过一个名为 Bitvise SSH 的程序,但今天我发现有一种方法可以通过 ZC1C425268E68385D1AB5074C7A 中的 ZC1C425268E68385D1AB5074C14Z 直接连接到我的实例。

my config我的配置

This is my config file for the SSH connection for the VS code SSH connection.这是我用于 VS 代码 SSH 连接的 SSH 连接的配置文件。

And apparently when I try to connect to the instance I get the error显然,当我尝试连接到实例时,我得到了错误

[15:49:16.843] Log Level: 2
[15:49:16.846] remote-ssh@0.70.0
[15:49:16.846] win32 x64
[15:49:16.847] SSH Resolver called for "ssh-remote+ec2-user", attempt 1
[15:49:16.847] "remote.SSH.useLocalServer": false
[15:49:16.848] "remote.SSH.showLoginTerminal": false
[15:49:16.848] "remote.SSH.remotePlatform": {}
[15:49:16.848] "remote.SSH.path": undefined
[15:49:16.848] "remote.SSH.configFile": C:\Users\algoo\.ssh\config\
[15:49:16.848] "remote.SSH.useFlock": true
[15:49:16.848] "remote.SSH.lockfilesInTmp": false
[15:49:16.848] "remote.SSH.localServerDownload": auto
[15:49:16.848] "remote.SSH.remoteServerListenOnSocket": false
[15:49:16.849] "remote.SSH.showLoginTerminal": false
[15:49:16.849] "remote.SSH.defaultExtensions": []
[15:49:16.849] "remote.SSH.loglevel": 2
[15:49:16.849] "remote.SSH.serverPickPortsFromRange": {}
[15:49:16.849] "remote.SSH.enableDynamicForwarding": true
[15:49:16.849] "remote.SSH.serverInstallPath": {}
[15:49:16.850] SSH Resolver called for host: ec2-user
[15:49:16.850] Setting up SSH remote "ec2-user"
[15:49:16.886] Using commit id "899d46d82c4c95423fb7e10e68eba52050e30ba3" and quality "stable" for server
[15:49:16.890] Install and start server if needed
[15:49:19.539] Checking ssh with "ssh -V"
[15:49:19.607] > OpenSSH_for_Windows_8.6p1, LibreSSL 3.3.3

[15:49:19.614] Using SSH config file "C:\Users\algoo\.ssh\config\"
[15:49:19.614] Running script with connection command: ssh -T -D 59628 -F "C:\Users\algoo\.ssh\config\" "ec2-user" bash
[15:49:19.617] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[15:49:19.860] > u]0;C:\WINDOWS\System32\cmd.exe
[15:49:19.861] Got some output, clearing connection timeout
[15:49:19.874] > sage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]
>            [-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
>            [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]
>            [-i identity_file] [-J [user@]host[:por
[15:49:19.889] > t]] [-L address]
>            [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
>            [-Q query_option] [-R address] [-S ctl_path] [-W host:port]
>            [-w local_tun[:remote_tun]] destination [command]
> The process tried to write to a nonexistent pipe.
[15:49:21.170] "install" terminal command done
[15:49:21.171] Install terminal quit with output:            [-w local_tun[:remote_tun]] destination [command]
[15:49:21.171] Received install output:            [-w local_tun[:remote_tun]] destination [command]
[15:49:21.172] Failed to parse remote port from server output
[15:49:21.173] Resolver error: Error: 
    at Function.Create (c:\Users\algoo\.vscode\extensions\ms-vscode-remote.remote-ssh-0.70.0\out\extension.js:1:430425)
    at Object.t.handleInstallOutput (c:\Users\algoo\.vscode\extensions\ms-vscode-remote.remote-ssh-0.70.0\out\extension.js:1:429068)
    at Object.t.tryInstall (c:\Users\algoo\.vscode\extensions\ms-vscode-remote.remote-ssh-0.70.0\out\extension.js:1:524212)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async c:\Users\algoo\.vscode\extensions\ms-vscode-remote.remote-ssh-0.70.0\out\extension.js:1:487216
    at async Object.t.withShowDetailsEvent (c:\Users\algoo\.vscode\extensions\ms-vscode-remote.remote-ssh-0.70.0\out\extension.js:1:490561)
    at async Object.t.resolve (c:\Users\algoo\.vscode\extensions\ms-vscode-remote.remote-ssh-0.70.0\out\extension.js:1:488295)
    at async c:\Users\algoo\.vscode\extensions\ms-vscode-remote.remote-ssh-0.70.0\out\extension.js:1:564197
[15:49:21.177] ------




[16:02:54.387] ConfigFileWatcher: start watching file:///c%3A/Users/algoo/.ssh/config/
[16:02:54.387] ConfigFileWatcher: adding save listener
[16:02:54.387] ConfigFileWatcher: adding close listener

is there anything that i missed out?有什么我错过的吗?

[15:49:16.848] "remote.SSH.path": undefined

^^^ Try setting the remote.SSH.path in settings.json and see if that works. ^^^ 尝试在settings.json中设置remote.SSH.path看看是否可行。 I use the one that comes with Git Bash我用的是 Git Bash 自带的那个

These are my settings by the way:顺便说一下,这些是我的设置:

  "remote.SSH.enableDynamicForwarding": false,
  "remote.SSH.lockfilesInTmp": true,
  "remote.SSH.path": "%ProgramFiles/Git/usr/bin/ssh.exe",
  "remote.SSH.useLocalServer": true,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM