From 4daff1ba79c6be3a84cda98d155d36f08be06fe1 Mon Sep 17 00:00:00 2001 From: Floris Bos Date: Mon, 14 Feb 2022 09:59:08 +0100 Subject: [PATCH] Do not enable "set username and password" automatically if public key auth is used --- OptionsPopup.qml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/OptionsPopup.qml b/OptionsPopup.qml index 0ecac78..df9f504 100644 --- a/OptionsPopup.qml +++ b/OptionsPopup.qml @@ -174,6 +174,9 @@ Popup { text: qsTr("Allow public-key authentication only") onCheckedChanged: { if (checked) { + if (chkSetUser.checked && fieldUserName.text == "pi" && fieldUserPassword.text.length == 0) { + chkSetUser.checked = false + } fieldPublicKey.forceActiveFocus() } } @@ -462,6 +465,12 @@ Popup { fieldHostname.text = settings.hostname chkHostname.checked = true } + if ('sshAuthorizedKeys' in settings) { + fieldPublicKey.text = settings.sshAuthorizedKeys + radioPubKeyAuthentication.checked = true + chkSSH.checked = true + } + if ('sshUserPassword' in settings) { fieldUserPassword.text = settings.sshUserPassword fieldUserPassword.alreadyCrypted = true @@ -477,11 +486,6 @@ Popup { fieldUserName.text = settings.sshUserName chkSetUser.checked = true } - if ('sshAuthorizedKeys' in settings) { - fieldPublicKey.text = settings.sshAuthorizedKeys - chkSSH.checked = true - radioPubKeyAuthentication.checked = true - } if ('wifiSSID' in settings) { fieldWifiSSID.text = settings.wifiSSID if ('wifiSSIDHidden' in settings && settings.wifiSSIDHidden) {