As you know almost all VPS providers give you the option to install OS with one click. I want to perform some tasks after OS has been installed such as:
- Setting root password
- Disabling root and adding new user
- Installing sudo, ufw, fail2ban etc.
- Install and configure nginx
- Install and configure mysql
Now I assume one way of doing it is to create a bash script that runs on start up and performs all the above functions. But the thing is not many VPS providers give the option to upload a startup script which means you have to manually run the script after VPS has been set up. Vultr is one provider (probably DO too) that gives you the option to run startup script while creating VPS so I was wondering if I can create a bash script that runs on start and do all these operations?
The second option is to create my own ISO with these preinstalled software and settings and use that ISO to install OS on VPS. My question is how can I create my own ISO?