fix(cli): use local ssh client for vm access#2442
Open
LopatinDmitr wants to merge 2 commits into
Open
Conversation
ab8e42b to
5969f19
Compare
e3cb34e to
57f6d8d
Compare
Use the local OpenSSH/SCP clients for VM access by default and remove the embedded native SSH/SCP implementation. Keep --local-ssh and --local-ssh-opts as deprecated compatibility flags, add --ssh-opts for extra client options, and map --known-hosts to OpenSSH UserKnownHostsFile. Signed-off-by: Dmitry Lopatin <dmitry.lopatin@flant.com>
Use local OpenSSH/SCP clients for VM access and remove the embedded native SSH/SCP implementation. Keep --local-ssh and --local-ssh-opts as deprecated compatibility flags. Pass common options such as --identity-file and --known-hosts directly to the local client, and allow advanced SSH/SCP options to be specified after --. Signed-off-by: Dmitry Lopatin <dmitry.lopatin@flant.com>
57f6d8d to
6dd0b06
Compare
diafour
reviewed
Jun 10, 2026
Comment on lines
167
to
169
| if err != nil { | ||
| return err | ||
| } |
Member
There was a problem hiding this comment.
As client is not needed for "local ssh", we can report the error and proceed with "default" as namespace.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Remove the embedded native SSH/SCP implementation from the virtualization CLI.
d8 v sshandd8 v scpnow always use the local OpenSSH/SCP clients throughd8 v port-forward --stdio=trueasProxyCommand.This change also:
--, for exampled8 v ssh vm -- -o StrictHostKeyChecking=no -R 8080:127.0.0.1:8080;--identity-file/-iis passed to OpenSSH/SCP as-i, and--known-hostsis passed asUserKnownHostsFile;--local-sshas a deprecated no-op compatibility flag;--local-ssh-optsas a deprecated compatibility flag;Why do we need it, and what problem does it solve?
We do not want to support and maintain two separate SSH/SCP clients in the virtualization CLI.
The embedded native implementation has limited compatibility and may behave differently from the OpenSSH client users already have configured locally. Keeping only the local OpenSSH/SCP path makes VM access more predictable: it uses the user's existing SSH configuration, agent, certificates, authentication behavior, and client options.
OpenSSH is also available on all supported user platforms, including Windows, so the CLI no longer needs a separate built-in SSH/SCP implementation as a fallback.
What is the expected result?
d8 v ssh user@vm -i /path/to/keyand verify that the command authenticates through local OpenSSH.d8 v scp -i /path/to/key ./file user@vm:/tmp/fileand verify that SCP uses the same local-client path.d8 v ssh -n myvms ubuntu-24 -p 2222 -- -o StrictHostKeyChecking=no -R 8080:127.0.0.1:8080and verify that options after--are passed to the local OpenSSH client.d8 v ssh -n myvms ubuntu-24 -p 2222 --command xclock -- -o StrictHostKeyChecking=no -X -nand verify that the remote command and local OpenSSH options are both applied.--local-sshor--local-ssh-optsand verify that they still work and print deprecation warnings.d8 v ssh user@vm --known-hosts /path/to/known_hostsand verify that OpenSSH uses it asUserKnownHostsFile.Checklist
Changelog entries