mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 16:05:21 +01:00
cloud-init: reorder ssh/user creation
This commit is contained in:
parent
566450c728
commit
243da48257
1 changed files with 8 additions and 5 deletions
|
@ -624,10 +624,6 @@ Popup {
|
|||
|
||||
addCloudInit(" lock_passwd: false")
|
||||
addCloudInit(" passwd: "+cryptedPassword)
|
||||
addCloudInit("")
|
||||
}
|
||||
if (chkSSH.checked && radioPasswordAuthentication.checked) {
|
||||
addCloudInit("ssh_pwauth: true")
|
||||
}
|
||||
|
||||
if (chkSSH.checked && radioPubKeyAuthentication.checked) {
|
||||
|
@ -640,7 +636,9 @@ Popup {
|
|||
}
|
||||
addFirstRun("echo 'PasswordAuthentication no' >>/etc/ssh/sshd_config")
|
||||
|
||||
addCloudInit(" lock_passwd: true")
|
||||
if (!chkSetUser.checked) {
|
||||
addCloudInit(" lock_passwd: true")
|
||||
}
|
||||
addCloudInit(" ssh_authorized_keys:")
|
||||
for (var i=0; i<pubkeyArr.length; i++) {
|
||||
var pk = pubkeyArr[i].trim();
|
||||
|
@ -650,6 +648,11 @@ Popup {
|
|||
}
|
||||
addCloudInit(" sudo: ALL=(ALL) NOPASSWD:ALL")
|
||||
}
|
||||
addCloudInit("")
|
||||
|
||||
if (chkSSH.checked && radioPasswordAuthentication.checked) {
|
||||
addCloudInit("ssh_pwauth: true")
|
||||
}
|
||||
|
||||
/* Rename first ("pi") user if a different desired username was specified */
|
||||
addFirstRun("if [ \"$FIRSTUSER\" != \""+fieldUserName.text+"\" ]; then")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue