Skip to content

sshutil.go handles key paths inconsistently on Windows platform #3167

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
arixmkii opened this issue Jan 28, 2025 · 0 comments · Fixed by #3300
Closed

sshutil.go handles key paths inconsistently on Windows platform #3167

arixmkii opened this issue Jan 28, 2025 · 0 comments · Fixed by #3300

Comments

@arixmkii
Copy link
Contributor

Description

Code in sshutil.go is different for path handling in different commands - ssh vs ssh-keygen:

It uses filepath for ssh-keygen

"-C", "lima", "-f", filepath.Join(configDir, filenames.UserPrivateKey))
but has path translation for ssh
privateKeyPath = ioutilx.CanonicalWindowsPath(privateKeyPath)

It doesn't look right to mix and match ssh tools from Windows installation and msys2/cygwin counterparts, so, they both should work identically (cygwin/msys2 does support implicit conversion, but if one uses wsl based tooling it will not). The idea is to make this behavior more strict - identify which tooling version is used as Windows adds market to the version output. Alternatively it could be a setting inside VM template as of which kind of tooling is expected - this will reduce overhead of calling ssh -V additionally every time.

I plan to work on a PR addressing this.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants