[solved] I receive a "Error waiting for SSH" when trying to use the Packer Arch template

I’m trying to build an Arch Linux vagrant box with manjaro-arm-installer installed since manjaro itself no longer has the minimum x86_64 architecture available as ARM is now dominant on servers and manjaro’s resources are oriented to several desktop environments.

Unfortunately, I can’t get an ssh connection anymore with the enable-ssh.sh script I got from the Packer Arch project.
Apart from the -crypt flag no longer being supported, though there’s other flags I can use,
I now simply cannot connect.

This is the error I now receive:

...
==> manjaro-arm-installer.qemu.main: Connecting to VM via VNC (127.0.0.1:5910)
==> manjaro-arm-installer.qemu.main: Typing the boot command over VNC...
    manjaro-arm-installer.qemu.main: Not using a NetBridge -- skipping StepWaitGuestAddress
==> manjaro-arm-installer.qemu.main: Using SSH communicator to connect: 127.0.0.1
==> manjaro-arm-installer.qemu.main: Waiting for SSH to become available...
==> manjaro-arm-installer.qemu.main: Error waiting for SSH: Packer experienced an authentication error when trying to connect via SSH. This can happen if your username/password are wrong. You may want to double-check your credentials as part of your debugging process. original error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
==> manjaro-arm-installer.qemu.main: Deleting output directory...
Build 'manjaro-arm-installer.qemu.main' errored after 3 minutes 21 seconds: Packer experienced an authentication error when trying to connect via SSH. This can happen if your username/password are wrong. You may want to double-check your credentials as part of your debugging process. original error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain  
...

Apparently, I set an ssh key, not an ssh password in the hcl file.

It now looks like this:

enable-ssh.sh

#!/usr/bin/env bash

USER=mai-box
PASSWORD=${USER}
PUBLIC_KEY=id_mai-box.pub
SSH_DIR=/home/mai-box/.ssh
A_KEYS=${SSH_DIR}/authorized_keys
PASSWORD=$(/usr/bin/openssl passwd -6 ${USER})
/usr/bin/useradd --password ${PASSWORD} --comment 'Mai-Box User' --create-home --user-group mai-box

mkdir -pm 700 ${SSH_DIR}
curl -s http://$1:$2/${PUBLIC_KEY} | tee ${A_KEYS} >/dev/null
chmod 0600 ${A_KEYS}
chown -R mai-box:mai-box ${SSH_DIR}

tee /etc/sudoers.d/10_mai-box &>/dev/null <<EOF
Defaults env_keep += "SSH_AUTH_SOCK"
mai-box ALL=(ALL) NOPASSWD: ALL 
EOF

/usr/bin/chmod 0440 /etc/sudoers.d/10_mai-box

/usr/bin/systemctl start sshd.service

my_packer_file.pkr.hcl

...
  boot_command_qemu = [
                    "<enter><wait1m>",
                    "/usr/bin/curl -O http://{{ .HTTPIP }}:{{ .HTTPPort }}/enable-ssh.sh<enter><wait3s>",
                    "/usr/bin/bash ./enable-ssh.sh {{ .HTTPIP }} {{ .HTTPPort }} <enter><wait15s>",
                  ]
...