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

SSH should prompt to change ~/.ssh/config #355

Closed
mgutz opened this issue May 28, 2023 · 7 comments
Closed

SSH should prompt to change ~/.ssh/config #355

mgutz opened this issue May 28, 2023 · 7 comments
Assignees

Comments

@mgutz
Copy link

mgutz commented May 28, 2023

devpod cli v0.1.7

I was surprised to find my ~/.ssh/config file was modified without my permission. I understand the need, but that action should ask for confirmation before modifying.

It might be better to store config entries in their own file so ~/.ssh is not touched at all. Use the -F flag like so

ssh -F ~/.config/devpod/ssh.config SOME_NAME

@pascalbreuninger pascalbreuninger self-assigned this May 30, 2023
@codeagencybe
Copy link

Weird...I have the opposite problem.
I can't run anything as it is complaining about not able to modify ssh config.
I already gave all the permissions upfront while installing DevPod and when I check my system privacy, security settings etc... there is nothing else to change or to give permissions.

This is the error I see appearing in the logs

[08:39:34] fatal open /Users/fabio/.ssh/config: permission denied write ssh config

@pascalbreuninger Any idea?
PS: I already gave up on Rancher Desktop with DevPod, just impossible to get it working so I reverted also to Docker Desktop but it doesn't bring me any closer. ref #340

@pascalbreuninger
Copy link
Member

What system are you on @codeagencybe? The proposed solution would also solve your problem as we shouldn't run into permission issues inside of the .devpod folder

@levsha
Copy link
Contributor

levsha commented Jul 23, 2023

It would be also better to only touch ~/.ssh/config once (maybe even during installation, or when start): to only add something like Include ~/.devpod/ssh_config.d/* there and then only add/remove/change files in ~/.devpod/ssh_config.d/

@pascalbreuninger
Copy link
Member

@levsha @codeagencybe you can run devpod up --ssh-config $ALTERNATIVE_CONFIG_PATH to use a different ssh config if you need to for the time being.
This isn't configurable from the UI right now but could be a global setting imo

@flokoe
Copy link

flokoe commented Aug 7, 2023

Hi, I stumbled across this behavior as well and find it very unfortunate that DevPod modifies my SSH config without my knowledge. This behavior does not seem to be mentioned in the docs.

Furthermore, DevPod seems to modify the SSH config on every startup, regardless of whether the config already exists, and append it to the end. This actually breaks the SSH config for DevPod, if you use a glob host block before the DevPod config. For example:

Host *
  User foobar

# DevPod Start workspace.devpod
Host workspace.devpod
  ForwardAgent yes
  LogLevel error
  StrictHostKeyChecking no
  UserKnownHostsFile /dev/null
  ProxyCommand /home/foobar/bin/devpod ssh --stdio --context default --user vscode puppet
  User vscode
# DevPod End workspace.devpod

The config after the glob block is unreachable because * will always match (SSH uses "use first match found"). Even if I move the DevPod block manually, on the next devpod up it will be moved to the end again. Maybe you could make use of the existing control comments and only modify lines between those comments to allow users to rearrange this block as needed.

@therford
Copy link

therford commented Jan 9, 2024

This worked for me

Host * !*.devpod
  User foo

# DevPod Start workspace.devpod
Host workspace.devpod
  ForwardAgent yes
  LogLevel error
  StrictHostKeyChecking no
  UserKnownHostsFile /dev/null
  ProxyCommand /Applications/DevPod.app/Contents/MacOS/devpod-cli ssh --stdio --context default --user node
  User node
# DevPod End workspace.devpod`
```

@pascalbreuninger
Copy link
Member

With v0.5.5 we prepend entries to the ssh config to avoid other configurations messing with the automated ones. Additionally you can alway set the context option to use a different config file:
devpod context set-options -o SSH_CONFIG_PATH=my/config/path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants