By cmellor
So you know when you spin up a new droplet and you first SSH into it and it asks you for the current password, then to change the password [twice]? Could this be done automatically say via a Bash/Shell script?
I’m looking to automate the process to where nobody has to SSH into a droplet and change it manually.
Surely possible, I just don’t know much about bash/shell scripting.
Thanks.
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!
I’m still confused here. How can I change the root pw via Bash so i don’t need to SSH in and do it manually or use SSH keys
The quickest solution would be to set up SSH keys on your account.
With this in place any client with the ssh private key will be able to make an ssh connection to your droplet without the need for a password and this password change prompt is never shown.
Alternately you could use the user-data section on the create screen to pass bash commands to your droplet on creation to set the root password. A few methods to accomplish this can be found here.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.