diff --git a/create.sh b/create.sh index ed52b77..91af3ee 100755 --- a/create.sh +++ b/create.sh @@ -173,13 +173,10 @@ case $OSKEUZE in case $SSH_KEYS_PATH in '') # leeg - virt-customize --run-command ' - CONFIG_FILE="/etc/cloud/cloud.cfg" - if ! grep -q "ssh_pwauth" "$CONFIG_FILE"; then - echo "ssh_pwauth: true" | sudo tee -a "$CONFIG_FILE" > /dev/null - else - sudo sed -i "s/^ssh_pwauth false/ssh_pwauth true/" "$CONFIG_FILE" - fi' -a /tmp/"$IMAGE_NAME" + virt-customize -a /tmp/"$IMAGE_NAME" \ + --run-command 'sed -i "s/^#PasswordAuthentication yes/PasswordAuthentication yes/" /etc/ssh/sshd_config' \ + --run-command 'sed -i "s/^PasswordAuthentication no/PasswordAuthentication yes/" /etc/ssh/sshd_config' \ + --run-command 'systemctl restart sshd' ;; /tmp/temporary_ssh_key.pub) # iets ;;