diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-08-12 13:06:02 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-12 13:06:02 -0400 |
commit | bb3eceae56821903f6c51bebf77e5ef425868918 (patch) | |
tree | 25d836502f83a079461c17fdc14a5c90621a7fbf /pkg | |
parent | 73fa527ae1f83b3db025e361d73bb7966ef69626 (diff) | |
parent | 6ff42395d08217d86055456a9130fef8f78d34e2 (diff) | |
download | podman-bb3eceae56821903f6c51bebf77e5ef425868918.tar.gz podman-bb3eceae56821903f6c51bebf77e5ef425868918.tar.bz2 podman-bb3eceae56821903f6c51bebf77e5ef425868918.zip |
Merge pull request #7295 from baude/msiremotefixes
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 e820e1c8b..ef9644de8 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 { |