diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-08-26 05:14:24 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-26 05:14:24 -0400 |
commit | 679da6c61b0ca56ba8d67507b3f81c6d730afeba (patch) | |
tree | 5da758a9077f167c9457c1d1550e5cba6a76ebf7 /cmd/podman | |
parent | 374b2c65cf310d86cd625f62a9b3604ae73d39c5 (diff) | |
parent | 31180fa2b16e96d18a793520f4ccb4ba5b4b658e (diff) | |
download | podman-679da6c61b0ca56ba8d67507b3f81c6d730afeba.tar.gz podman-679da6c61b0ca56ba8d67507b3f81c6d730afeba.tar.bz2 podman-679da6c61b0ca56ba8d67507b3f81c6d730afeba.zip |
Merge pull request #7450 from baude/v2msiremotestuff
podman-remote fixes for msi and client
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/system/connection/add.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/cmd/podman/system/connection/add.go b/cmd/podman/system/connection/add.go index 77a2edf8a..14bd94d5a 100644 --- a/cmd/podman/system/connection/add.go +++ b/cmd/podman/system/connection/add.go @@ -124,6 +124,7 @@ func add(cmd *cobra.Command, args []string) error { cfg.Engine.ServiceDestinations = map[string]config.Destination{ args[0]: dst, } + cfg.Engine.ActiveService = args[0] } else { cfg.Engine.ServiceDestinations[args[0]] = dst } @@ -181,12 +182,20 @@ func getUDS(cmd *cobra.Command, uri *url.URL) (string, error) { authMethods = append(authMethods, ssh.PublicKeysCallback(a.Signers)) } - config := &ssh.ClientConfig{ + if len(authMethods) == 0 { + pass, err := terminal.ReadPassword(fmt.Sprintf("%s's login password:", uri.User.Username())) + if err != nil { + return "", err + } + authMethods = append(authMethods, ssh.Password(string(pass))) + } + + cfg := &ssh.ClientConfig{ User: uri.User.Username(), Auth: authMethods, HostKeyCallback: ssh.InsecureIgnoreHostKey(), } - dial, err := ssh.Dial("tcp", uri.Host, config) + dial, err := ssh.Dial("tcp", uri.Host, cfg) if err != nil { return "", errors.Wrapf(err, "failed to connect to %q", uri.Host) } |