diff options
author | Brent Baude <bbaude@redhat.com> | 2020-08-11 13:44:29 -0500 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-08-12 09:19:52 -0500 |
commit | 6ff42395d08217d86055456a9130fef8f78d34e2 (patch) | |
tree | 907e60d391d4379b38f1a5f5909aaf9c0c913fa6 /cmd/podman/system | |
parent | 8eaacec150df782c291e9c6046bb0db010dd2f08 (diff) | |
download | podman-6ff42395d08217d86055456a9130fef8f78d34e2.tar.gz podman-6ff42395d08217d86055456a9130fef8f78d34e2.tar.bz2 podman-6ff42395d08217d86055456a9130fef8f78d34e2.zip |
podman-remote fixes for msi and client
correct small typo that sets the path on windows via the msi xml.
in the remote client, prompt for SSH password when no identity or alternate means of authentication are provided.
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podman/system')
-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 89cea10ca..af13b970c 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) } |