-
Notifications
You must be signed in to change notification settings - Fork 310
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
"Add New SSH Host..." option overrides valid ssh config #10640
Comments
A colleague pointed out that if the Teleport config is moved into a separate file (e.g. I still think it's strange to add these blocks to the config file, but at least this gives a way to work around it without manual intervention each time a host is added. |
Thanks for the feedback. In case it's helpful, for one-off connections you can use Is your suggestion that we should continue honoring the SSH config but never modify it (read but not write)? Is it not clear that Screen.Recording.2025-01-17.at.10.40.25.AM.mov
I suppose we can change the ordering of applying to the configuration, but I suspect that people would have different definitions of what is the "right" spot. I think the intent of this feature was to make it more convenient by not diverging what you use in VS Code from what you'd use outside of VS Code. Looking forward to hearing more of your thoughts |
Yes, it does that (though - separate issue - the locations it suggests include C:\ProgramData\ssh\ssh_config, which my normal user account doesn't have write access to, and the "specify a custom configuration file" option doesn't appear to actually do anything).
I'd certainly retain the behaviour of listing hosts that have their own blocks in the SSH config at this point. Given where we are, allowing it to create TL;DR: Just don't override the |
When adding a host with the
Add New SSH Host...
option, Remote-SSH adds a block to the start of the .ssh/config file:My ssh config uses Teleport. This contains config along the lines of
The effect is that the Host block added by Remote-SSH overrides the
HostName
entry in the Teleport config (SSH takes the value from the first Host block which matches the host it's connecting to). The end result is that it gets confused about the hostname, gives aHost key for <hostname> has changed and you have requested strict checking
error, and fails to connect.Moving the generated
Host
block after the Teleport config, manually adding the domain to the generated HostName, or entirely deleting the HostName line all work around the problem.I'd suggest that:
Host myhost
block appears to be sufficient to keep track of the existence of the host.The text was updated successfully, but these errors were encountered: