diff --git a/pkg/machine/applehv/machine.go b/pkg/machine/applehv/machine.go index 58ea2676ea..095ad65213 100644 --- a/pkg/machine/applehv/machine.go +++ b/pkg/machine/applehv/machine.go @@ -573,6 +573,7 @@ func AppleHVSSH(username, identityPath, name string, sshPort int, inputArgs []st port := strconv.Itoa(sshPort) args := []string{"-i", identityPath, "-p", port, sshDestination, + "-o", "IdentitiesOnly=yes", "-o", "StrictHostKeyChecking=no", "-o", "LogLevel=ERROR", "-o", "SetEnv=LC_ALL="} if len(inputArgs) > 0 { args = append(args, inputArgs...) diff --git a/pkg/machine/ssh.go b/pkg/machine/ssh.go index 2c40f06bb9..2a732302c1 100644 --- a/pkg/machine/ssh.go +++ b/pkg/machine/ssh.go @@ -16,6 +16,7 @@ func CommonSSH(username, identityPath, name string, sshPort int, inputArgs []str port := strconv.Itoa(sshPort) args := []string{"-i", identityPath, "-p", port, sshDestination, + "-o", "IdentitiesOnly=yes", "-o", "StrictHostKeyChecking=no", "-o", "LogLevel=ERROR", "-o", "SetEnv=LC_ALL="} if len(inputArgs) > 0 { args = append(args, inputArgs...) diff --git a/pkg/machine/wsl/machine.go b/pkg/machine/wsl/machine.go index 16dfd5abde..fbad357043 100644 --- a/pkg/machine/wsl/machine.go +++ b/pkg/machine/wsl/machine.go @@ -1492,7 +1492,10 @@ func (v *MachineVM) SSH(name string, opts machine.SSHOptions) error { sshDestination := username + "@localhost" port := strconv.Itoa(v.Port) - args := []string{"-i", v.IdentityPath, "-p", port, sshDestination, "-o", "UserKnownHostsFile /dev/null", "-o", "StrictHostKeyChecking no"} + args := []string{"-i", v.IdentityPath, "-p", port, sshDestination, + "-o", "IdentitiesOnly yes", + "-o", "UserKnownHostsFile /dev/null", + "-o", "StrictHostKeyChecking no"} if len(opts.Args) > 0 { args = append(args, opts.Args...) } else {