mirror of
https://github.com/containers/podman.git
synced 2025-06-20 09:03:43 +08:00
Merge pull request #11440 from ashley-cui/ssh
Use default username for podman machine ssh
This commit is contained in:
@ -488,7 +488,12 @@ func (v *MachineVM) SSH(name string, opts machine.SSHOptions) error {
|
||||
return errors.Errorf("vm %q is not running.", v.Name)
|
||||
}
|
||||
|
||||
sshDestination := v.RemoteUsername + "@localhost"
|
||||
username := opts.Username
|
||||
if username == "" {
|
||||
username = v.RemoteUsername
|
||||
}
|
||||
|
||||
sshDestination := username + "@localhost"
|
||||
port := strconv.Itoa(v.Port)
|
||||
|
||||
args := []string{"-i", v.IdentityPath, "-p", port, sshDestination, "-o", "UserKnownHostsFile /dev/null", "-o", "StrictHostKeyChecking no"}
|
||||
|
Reference in New Issue
Block a user