Hi,
this topic already came up during the last two community meetings.
Currently, virtctl ssh and scp support two methods for establishing a
connection to remote hosts. The first method is a native SSH client
builtin to virtctl and the second method is to wrap the local SSH/SCP
clients on the host running virtctl. Both methods can be switched by
passing the "--local-ssh" flag and at the moment the default is to use
the native SSH client.
However, there are some issues with the native SSH client, which are
starting to add up. For example:
- No support for SSH escape sequences [1]
- Weird behavior with SSH agents [2], [3]
- This is security sensitive code which we need to maintain
- Complex build system to allow excluding the native SSH client from
builds
- ...
Many of these issues are not trivial to address and in my opinion, the
use of a wrapped SSH/SCP client brings the user experience closer to
what a user of a regular OpenSSH client would expect from virtctl ssh
as well.
Therefore, I would like to propose to deprecate and eventually to
remove the SSH/SCP clients built into virtctl and instead to only use
the local SSH/SCP clients on the host running virtctl.
This should be a transparent change to users, as command lines like
`virtctl ssh user@myvm` should continue to work without any changes
required. I'm still going to verify this for MacOS/Windows and will
post an update once I'm done.
I've already opened a PR ([4]) to deprecate the "--local-ssh" flag and
to use local ssh by default. Ideally, I'd like to merge this for
KubeVirt 1.5 and to remove the native clients in 1.6 already, if nobody
is against it.
What do you think?
Thanks,
Felix
[1]
https://github.com/kubevirt/kubevirt/issues/13475
[2]
https://github.com/kubevirt/kubevirt/issues/7072#issuecomment-1022998700
[3]
https://github.com/kubevirt/kubevirt/pull/12431
[4]
https://github.com/kubevirt/kubevirt/pull/13871