@delta cheers. I just added a public key to the server to avoid further headaches.
Edit: to clarify: there were no public keys involved. SSH password authentication for root. The script asked me the password and then fails because further on it expected public key authentication and doesn't find any matching keys.
I would mention this explicitly in the docs as a requirement. An option to run locally in the server would also be really appreciated.
You can always set up ssh key without passphrase for this one job - then delete it ;-)
https://blog.jurkiewicz.tech/ssh-from-linux-to-linux-in-10-seconds-35b46ffd31cd
ssh-keygen -t ed25519 -C "deploy".ssh-copy-id root@yourDomainName.hostnamectl set-hostname *domain name*, but I don't remember why. Then do sudo nano /etc/ssh/sshd_config and make PasswordAuthentication no.