Skip to content

RemoteCommand with SSH is ignored #158

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

Closed
MOZGIII opened this issue May 5, 2019 · 6 comments
Closed

RemoteCommand with SSH is ignored #158

MOZGIII opened this issue May 5, 2019 · 6 comments
Labels
ssh Issue in vscode-remote SSH

Comments

@MOZGIII
Copy link

MOZGIII commented May 5, 2019

  • VSCode Version: 1.34.0-insider (user setup), 473af338e1bd9ad4d9853933da1cd9d5d9e07dc9
  • Local OS Version: Windows 10 1809
  • Remote OS Version: Ubuntu 18.04
  • Remote Extension/Connection Type: SSH

Steps to Reproduce:

  1. I set RemoteCommand to my custom shell I like to use for ssh connections at .ssh/config.
  2. I connect to the remote host and default shell is used in the integrated terminal.

Does this issue occur when you try this locally?: Not applicable
Does this issue occur when you try this locally and all extensions are disabled?: Not applicable

@egamma egamma added the ssh Issue in vscode-remote SSH label May 6, 2019
@roblourens
Copy link
Member

Sorry for the delayed response. To set your default shell, use the setting "terminal.integrated.shell.linux": "/bin/bash". In fact, having RemoteCommand in your ssh config can break the ssh connection process so I'm surprised if you don't see it broken.

@MOZGIII
Copy link
Author

MOZGIII commented May 20, 2019

How am I supposed to set it per server? Doesn’t sound like a viable solution to me.

@Chuxel
Copy link
Member

Chuxel commented May 20, 2019

@MOZGIII F1 > Preferences: Open Remote Settings when connected to the SSH host. Also available from the settings UI under the remote tab.

See https://code.visualstudio.com/docs/remote/ssh#_ssh-hostspecific-settings

@MOZGIII
Copy link
Author

MOZGIII commented May 20, 2019

Cool, works for me

@tiago-af-silva
Copy link

I've experienced the same issue while trying to use RemoteCommand in my ~/.ssh/config to switch users after connecting. Had something like this:

Host server1
  HostName hostname
  Port 123
  User user1
  RemoteCommand sudo su user2
  RequestTTY yes

Logs showed me the extension was adding -o RemoteCommand=none to the SSH command, no matter what command I would specify. The only way to make it work was to revert the Remote - SSH (Nightly) extension back to version 2019.5.38340.

  • VSCode Version: 1.36.0-insider
  • Local OS Version: macOS High Sierra 10.13.6
  • Local OpenSSH Version: 8.0
  • Remote OS Version: Ubuntu 16.04 x86_64
  • Remote Extension/Connection Type: SSH

@roblourens
Copy link
Member

Yes, this isn't supported. We just use ssh to forward a port from the server, and ssh doesn't allow you to use RemoteCommand while forwarding a port (and it wouldn't have the affect you expect anyway)

@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ssh Issue in vscode-remote SSH
Projects
None yet
Development

No branches or pull requests

5 participants