Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't connect with RemoteCommand in ssh config #481

Closed
roblourens opened this issue May 28, 2019 · 7 comments
Closed

Can't connect with RemoteCommand in ssh config #481

roblourens opened this issue May 28, 2019 · 7 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug ssh Issue in vscode-remote SSH verified Verification succeeded
Milestone

Comments

@roblourens
Copy link
Member

This has come up several times but there is not one issue that only hits this.

Add a line like this to your ssh config: RemoteCommand bash -l. Some people like to do this to set a default shell. But they will get an error message like Cannot execute command-line and remote command. because we can't pass the install script when a RemoteCommand is defined.

Fixing this to override RemoteCommand in all of our generated ssh commands.

@roblourens roblourens self-assigned this May 28, 2019
@roblourens roblourens added bug Issue identified by VS Code Team member as probable bug ssh Issue in vscode-remote SSH labels May 28, 2019
@roblourens roblourens added this to the May 2019 milestone May 28, 2019
@roblourens
Copy link
Member Author

RemoteCommand is not supported before SSH 7.6 which is not that old, so I should only set this if the user has it in their config.

@bwesterhaus
Copy link

Can I get some clarification here? I have ssh v7.6, and when I put a RemoteCommand in the .ssh/config file, I get the above error, Cannot execute command-line and remote command.. When I connect via ssh locally, it works no problem. It seems to me the generated ssh commands are not ignoring RemoteCommand, but it is still failing.

@roblourens
Copy link
Member Author

Can you share your ssh config? Seems we are not detecting your RemoteCommand

@bwesterhaus
Copy link

bwesterhaus commented Jul 10, 2019

Host tbcs
    User ubuntu
    HostName remote.url
    Port 3463
    IdentityFile C:\Path\To\Key.pem
    RequestTTY force
    RemoteCommand ssh -p59990 root@localhost

It could be that the problem is that I'm ssh'ing a second time, but the config does work when I ssh via command line.

@roblourens
Copy link
Member Author

I can't reproduce this, can you share the log from the Remote - SSH output channel?

@bwesterhaus
Copy link

bwesterhaus commented Jul 11, 2019

Sure!

[email protected]
win32 x64
SSH Resolver called for "ssh-remote+tbcs", attempt 1
SSH Resolver called for host: tbcs
Setting up SSH remote "tbcs"
Using commit id "0f3794b38477eea13fb47fbe15a42798e6129338" and quality "stable" for server
Testing ssh with ssh -V
ssh exited with code: 0
Got stderr from ssh: OpenSSH_for_Windows_7.6p1, LibreSSL 2.6.4
Install and start server if needed
> 
> Cannot execute command-line and remote command.
> The process tried to write to a nonexistent pipe.
> 
"install" terminal command done
Received install output: The process tried to write to a nonexistent pipe.
The process tried to write to a nonexistent pipe
------

@roblourens
Copy link
Member Author

I can repro it, just on windows, thanks

@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug ssh Issue in vscode-remote SSH verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants