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

Test Remote-SSH: Use RemoteCommand in connection. #6221

Closed
3 tasks done
tanhakabir opened this issue Jan 25, 2022 · 3 comments
Closed
3 tasks done

Test Remote-SSH: Use RemoteCommand in connection. #6221

tanhakabir opened this issue Jan 25, 2022 · 3 comments
Labels
ssh Issue in vscode-remote SSH testplan-item
Milestone

Comments

@tanhakabir
Copy link

tanhakabir commented Jan 25, 2022

Refs: #4474

Complexity: 3

Create Issue


We want to make sure

Prerequisites:

  1. Use the pre-release of the Remote-SSH extension
  2. SSH into your own machine: Windows, macOS, and Linux to get one set up locally.

Steps:

  1. Set remote.SSH.useLocalServer to true and remote.SSH.enableRemoteCommand to true.
  2. Edit your SSH config for your remote to include RemoteCommand field with switching user with su.
  3. Connect to your remote.
  4. Verify you can successfully connect.
  5. Check that terminal starts with the switched user.
@tanhakabir tanhakabir added ssh Issue in vscode-remote SSH testplan-item labels Jan 25, 2022
@lszomoru
Copy link
Member

@tanhakabir, could you please provide a sample SSH config? Thank you!

@rzhao271 rzhao271 assigned rzhao271 and unassigned meganrogge Jan 25, 2022
@tanhakabir
Copy link
Author

This is a config I used to connect:

Host second
  HostName 147.182.250.143
  User root
  RemoteCommand su test

@tanhakabir tanhakabir added this to the January 2022 milestone Jan 25, 2022
@rzhao271
Copy link

I had some trouble testing the feature on Windows, but after discussing with Tanha, we got it. The following might help for other OSes too:

  • I explicitly set "remote.SSH.useLocalServer": true in my settings file.
  • For RemoteCommand, I used RemoteCommand bash -c "export TESTKEY=testvalue; bash", and then in the bash terminal on the opened SSH window, I ran env | grep TEST and confirmed that that environment variable was set.

@rzhao271 rzhao271 removed their assignment Jan 25, 2022
@JacksonKearl JacksonKearl removed their assignment Jan 26, 2022
@lszomoru lszomoru removed their assignment Jan 26, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Mar 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ssh Issue in vscode-remote SSH testplan-item
Projects
None yet
Development

No branches or pull requests

5 participants