Issue
I have the problem when I want to connect in vs code to a aws codecatalyst dev environment via the aws toolkit extension, that the vscode ssh remote environment gets stuck in connecting to the host at
"Setting up SSH Host (details) Initializing VS Code Server"
After trying to connect via ssh I got the error message with more details:
"kex_exchange_identification: Connection closed by remote host
Connection closed by UNKNOWN port 65535"
Any Ideas?
Solution
After a long and tedious error search I finally could solve the issue.
Host aws-devenv-*
ForwardAgent yes
AddKeysToAgent yes
StrictHostKeyChecking accept-new
ProxyCommand "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy RemoteSigned -File "c:\Users\{username}\AppData\Roaming\Code\User\globalStorage\amazonwebservices.aws-toolkit-vscode\codecatalyst_connect.ps1" %h
This command invokes a somehow not really documented and updated powershell script generated from the toolkit.
By debugging this script I found, that it makes an http POST request by using the windows powershell "Invoke-WebRequest" command. This command has given an error, which has not been logged.
The error was due to missing capabilities to parse the http response, to fix this the Internet Explorer or Edge needed to be run at least once. If this has not happend, windows does not initialize some libraries to use in powershell...
So everyone having these issues on windows when want to connect to aws codecatalyst dev environemtns via VSCode make sure to do the following:
- have openssh installed version > 7.6
- have run InternetExplorer or Edge at least one time
Imagine I would have tested this on a windows os where IE or Edge would have been run/initilaized already, would have never found this bug....
Answered By - Jost Answer Checked By - Mildred Charles (WPSolving Admin)