Update create.sh

This commit is contained in:
Blackwhitebear8 2024-12-10 13:27:39 +01:00
parent 646031a735
commit 0e0b54c572

View file

@ -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
;;