summaryrefslogtreecommitdiff
path: root/pkg/bindings
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-08-11 13:44:29 -0500
committerBrent Baude <bbaude@redhat.com>2020-08-12 09:19:52 -0500
commit6ff42395d08217d86055456a9130fef8f78d34e2 (patch)
tree907e60d391d4379b38f1a5f5909aaf9c0c913fa6 /pkg/bindings
parent8eaacec150df782c291e9c6046bb0db010dd2f08 (diff)
downloadpodman-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 'pkg/bindings')
-rw-r--r--pkg/bindings/connection.go10
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 {