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 /pkg | |
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 'pkg')
-rw-r--r-- | pkg/bindings/connection.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pkg/bindings/connection.go b/pkg/bindings/connection.go index 4fed48237..ea659ad94 100644 --- a/pkg/bindings/connection.go +++ b/pkg/bindings/connection.go @@ -180,8 +180,9 @@ func pingNewConnection(ctx context.Context) error { } func sshClient(_url *url.URL, secure bool, passPhrase string, identity string) (Connection, error) { + // if you modify the authmethods or their conditionals, you will also need to make similar + // changes in the client (currently cmd/podman/system/connection/add getUDS). authMethods := []ssh.AuthMethod{} - if len(identity) > 0 { auth, err := terminal.PublicKey(identity, []byte(passPhrase)) if err != nil { @@ -205,6 +206,13 @@ func sshClient(_url *url.URL, secure bool, passPhrase string, identity string) ( if pw, found := _url.User.Password(); found { authMethods = append(authMethods, ssh.Password(pw)) } + if len(authMethods) == 0 { + pass, err := terminal.ReadPassword("Login password:") + if err != nil { + return Connection{}, err + } + authMethods = append(authMethods, ssh.Password(string(pass))) + } callback := ssh.InsecureIgnoreHostKey() if secure { |