-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
Fix ssh config resolution #69
Fix ssh config resolution #69
Conversation
I had to revert your changes since it introduce the bug for to much people. We can keep in touch to find another solution. |
Understandable. Though I feel like this is a quirk of
Would you like me to create a new issue to track this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect
Hello @clemyan, Would be awesome if you can still take a look at it. Is it possible for you ? 🙂 |
Sorry for the late reply. I have spent some time looking into this again, but I don't think any of the things blocking this has been addressed. Problem statementWhat this PR aimed to solve is this: The way vscode-sftp parses SSH config files is not compliant with the OpenSSH client configuration file format The said format is specified in the ssh_config(5) man page. In particular, these config sections are not resolved correctly
This in turn is because vscode-sftp uses
Attempted Solution (this PR)The natural solution would be using A common SSH setup is like this:
In this setup, with most SSH clients (notably, the OpenSSH client), this happens:
Thus, people that have a SSH config with a wrong/invalid private key may never have any trouble using common SSH clients because they simply fallback to password authentication. The user is never even prompted for the passphrase. However, After this PR is merged, vscode-sftp finds a passphrased private key and errors, even if a password is provided in SolutionSo, what can be done? I see a few possibilities
I started this PR because it would have improved my workflow and it is a small change. My team has since changed our workflow so we aren't using SFTP anymore. So, honestly I don't care anymore and I won't have the time or bandwidth to write and test large refactors. The changes I made here should still work so if you go the breaking change route I don't think you need help from me either. I am open to discussing and exploring other solutions if you have ideas. |
Fixes ssh config resolution.
When resolving ssh config,
ssh-config
's.find
method is currently used. However fromssh-config
's documentation:This PR changes ssh config resolution to use
.compute
instead as suggested.In particular, this allow this extension to handle:
Unfortunately,
ssh2
does not support attempting multiple private keys OOTB, so I matched the current behavior of only using the first key.