I am writing a script to migrate droplets from an old OS to a new OS.
The script uses the API to create a new droplet from an image (a snapshot of a partially configured system based on Ubuntu 22 that has already had its initial password changed), and the image has an SSH key for root to allow my script to SCP files to the new server and run some commands via SSH.
The problem is that the SCP and SSH commands fail with the message
You are required to change your password immediately (administrator enforced).
WARNING: Your password has expired.
Password change required but no TTY available.
Is there a way that I can automate changing the initial password to prevent this from happening (presumably via the API), or a different way I should be doing this?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.