Skip to content

Commit

Permalink
try interactive at last (#3886)
Browse files Browse the repository at this point in the history
  • Loading branch information
davies authored Jul 6, 2023
1 parent 84d7507 commit 7255da5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/object/sftp.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,10 +452,7 @@ func newSftp(endpoint, username, pass, token string) (ObjectStorage, error) {
username = unescape(username)
var auth []ssh.AuthMethod
if pass != "" {
pass = unescape(pass)
auth = append(auth, ssh.Password(pass))
} else {
auth = append(auth, ssh.KeyboardInteractive(sshInteractive))
auth = append(auth, ssh.Password(unescape(pass)))
}

var signers []ssh.Signer
Expand Down Expand Up @@ -506,6 +503,10 @@ func newSftp(endpoint, username, pass, token string) (ObjectStorage, error) {
auth = append(auth, ssh.PublicKeys(signers...))
}

if pass == "" {
auth = append(auth, ssh.KeyboardInteractive(sshInteractive))
}

config := &ssh.ClientConfig{
User: username,
HostKeyCallback: ssh.InsecureIgnoreHostKey(),
Expand Down

0 comments on commit 7255da5

Please sign in to comment.