prioritize pubkey auth over password (fixes #2894)

This commit is contained in:
Eugene Pankov 2020-08-13 15:05:05 +02:00
parent 0e012a90ea
commit 59ce7eeee6
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -200,9 +200,6 @@ export class SSHService {
}
const authMethodsLeft = ['none']
if (!session.connection.auth || session.connection.auth === 'password') {
authMethodsLeft.push('password')
}
if (!session.connection.auth || session.connection.auth === 'publicKey') {
if (!privateKey) {
log('\r\nPrivate key auth selected, but no key is loaded\r\n')
@ -217,6 +214,9 @@ export class SSHService {
authMethodsLeft.push('agent')
}
}
if (!session.connection.auth || session.connection.auth === 'password') {
authMethodsLeft.push('password')
}
if (!session.connection.auth || session.connection.auth === 'keyboardInteractive') {
authMethodsLeft.push('keyboard-interactive')
}