prefer saved password to keyboard interactive auth

This commit is contained in:
Eugene 2025-01-29 10:37:28 +01:00
parent 4197cefdfd
commit 5d2d179677
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -194,13 +194,6 @@ export class SSHSession {
})
}
}
if (!this.profile.options.auth || this.profile.options.auth === 'keyboardInteractive') {
const savedPassword = this.profile.options.password ?? await this.passwordStorage.loadPassword(this.profile)
if (savedPassword) {
this.allAuthMethods.push({ type: 'keyboard-interactive', savedPassword })
}
this.allAuthMethods.push({ type: 'keyboard-interactive' })
}
if (!this.profile.options.auth || this.profile.options.auth === 'password') {
if (this.profile.options.password) {
this.allAuthMethods.push({ type: 'saved-password', password: this.profile.options.password })
@ -209,6 +202,15 @@ export class SSHSession {
if (password) {
this.allAuthMethods.push({ type: 'saved-password', password })
}
}
if (!this.profile.options.auth || this.profile.options.auth === 'keyboardInteractive') {
const savedPassword = this.profile.options.password ?? await this.passwordStorage.loadPassword(this.profile)
if (savedPassword) {
this.allAuthMethods.push({ type: 'keyboard-interactive', savedPassword })
}
this.allAuthMethods.push({ type: 'keyboard-interactive' })
}
if (!this.profile.options.auth || this.profile.options.auth === 'password') {
this.allAuthMethods.push({ type: 'prompt-password' })
}
this.allAuthMethods.push({ type: 'hostbased' })