Do not enable "set username and password" automatically if public key auth is used

This commit is contained in:
Floris Bos 2022-02-14 09:59:08 +01:00
parent eb011bb049
commit 4daff1ba79

View file

@ -174,6 +174,9 @@ Popup {
text: qsTr("Allow public-key authentication only") text: qsTr("Allow public-key authentication only")
onCheckedChanged: { onCheckedChanged: {
if (checked) { if (checked) {
if (chkSetUser.checked && fieldUserName.text == "pi" && fieldUserPassword.text.length == 0) {
chkSetUser.checked = false
}
fieldPublicKey.forceActiveFocus() fieldPublicKey.forceActiveFocus()
} }
} }
@ -462,6 +465,12 @@ Popup {
fieldHostname.text = settings.hostname fieldHostname.text = settings.hostname
chkHostname.checked = true chkHostname.checked = true
} }
if ('sshAuthorizedKeys' in settings) {
fieldPublicKey.text = settings.sshAuthorizedKeys
radioPubKeyAuthentication.checked = true
chkSSH.checked = true
}
if ('sshUserPassword' in settings) { if ('sshUserPassword' in settings) {
fieldUserPassword.text = settings.sshUserPassword fieldUserPassword.text = settings.sshUserPassword
fieldUserPassword.alreadyCrypted = true fieldUserPassword.alreadyCrypted = true
@ -477,11 +486,6 @@ Popup {
fieldUserName.text = settings.sshUserName fieldUserName.text = settings.sshUserName
chkSetUser.checked = true chkSetUser.checked = true
} }
if ('sshAuthorizedKeys' in settings) {
fieldPublicKey.text = settings.sshAuthorizedKeys
chkSSH.checked = true
radioPubKeyAuthentication.checked = true
}
if ('wifiSSID' in settings) { if ('wifiSSID' in settings) {
fieldWifiSSID.text = settings.wifiSSID fieldWifiSSID.text = settings.wifiSSID
if ('wifiSSIDHidden' in settings && settings.wifiSSIDHidden) { if ('wifiSSIDHidden' in settings && settings.wifiSSIDHidden) {