Steps to Reproduce:
SSH Resolver called for "ssh-remote+my-host"
SSH Resolver called for host: my-host
Setting up SSH remote "my-host"
Using commit id "473af338e1bd9ad4d9853933da1cd9d5d9e07dc9" and quality "insider" for server
Install and start server if needed
> Warning: no access to tty (Bad file descriptor).
> Thus no job control in this shell.
> INSTALL_SCRIPT=/tmp/tmp.kUk4quopx4/vscode-remote-install.473af338e1bd9ad4d9853933da1cd9d5d9e07dc9.sh: Command not found.
> INSTALL_SCRIPT: Undefined variable.
"install" terminal command done
Received install output: INSTALL_SCRIPT: Undefined variable.
Failed to parse remote port from server output: INSTALL_SCRIPT: Undefined variable.
Does this issue occur when you try this locally?: N/A - issue with connecting
Does this issue occur when you try this locally and all extensions are disabled?: N/A
To me, it looks like an issue with trying to run the script in tcsh (setting a variable in tcsh is set INSTALL_SCRIPT=/path/to/script.csh, for example).
Btw I can confirm that changing the default shell to bash fixed the problem.
I can confirm the same problem, but I am now allowed to change my default shell.
This breaks under the fish shell too. Perhaps VSCode should invoke bash explicitly instead of running commands in the user's shell.
Same for me. I can execute bash but not allowed to change the default shell in the company gateway environment.
As a workaround one can setup the ssh configuration (.ssh/config file) as below. Note that you should change the HOSTNAME and USERNAME accordingly.
Host ALIAS
HostName HOSTNAME
User USERNAME
RemoteCommand bash -l
After the successful ssh, 'bash -l' command will be run to give an interactive bash shell.
This approach using the RemoteCommand succeeds for the install, but then fails later when trying to set up the tunnel, as the SSH tunnel fails to establish because of the command line and remote command pair
Spawning tunnel with: ssh vscode-machine1 -L localhost:54419:localhost:44065 "echo -e 'Connected to SSH Host - Please do not close this terminal' && sleep infinity"
Spawned SSH tunnel between local port 54419 and remote port 44065
Waiting for ssh tunnel to be ready
Cannot execute command-line and remote command.
I can also confirm that changing the default shell to bash fixed the problem for me.
I can also confirm that changing the default shell to bash fixed the problem for me.
This is fixed in the new "nightly" build of the ssh extension, would appreciate people trying it to let me know if there's still an issue: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh-nightly (uninstall the stable version too)
I confirm it's working. Thanks for fixing.
things are still not working for me via the nightly, feels like its gotten worst
Im trying to connect from my windows box to Linux box.
Confirming that batbox is a valid reachable host
Running type "C:\Users\Savio\AppData\Local\Temp\vscode-linux-multi-line-command-batbox.sh" | ssh batbox bash to confirm the host platform
>
> Cannot execute command-line and remote command.
>
"uname" terminal command done
batbox: unreachable or not Linux x86_64. (Cannot execute command-line and remote command.)
@artbycrunk RemoteCommand is also not supported in your ssh config, this is a separate issue.
@roblourens It works now !!
I had RemoteCommand bash -l in my ssh config, from some previous workaround..
had to remove it, and now it works like a charm... thanks.
Great, the new nightly SSH extension actually fixes the RemoteCommand issue too.
still don't work for my connecting to mac sshd - Can't connect to 'macserver': unreachable or not Linux x86_64 (command-line: line 0: Bad configuration option: remotecommand )
Connecting to a mac is not supported, only linux. But I'm worried that this error is coming from the client side because I now launch with -o RemoteCommand=none. What is the output of ssh -V on the client? And what is your client platform?
Ok I realized that RemoteCommand will fail in slightly older versions of SSH, so I will back out that change. https://github.com/microsoft/vscode-remote-release/issues/481
Most helpful comment
This breaks under the fish shell too. Perhaps VSCode should invoke bash explicitly instead of running commands in the user's shell.