Using Static Password In Autoscale Group’s VMs
-
Create a VPC and add a network tier inside the VPC.
-
Create a Virtual Machine using the standard templates.
-
Launch the console and login with the initial password (Generated at the time of VM Creation).
-
Run the following commands.
- Create own password.
sudo passwd <yourusername>
(ubuntu/root) - Disable the password expiry.
sudo chage -I -1 -m 0 -M 99999 -E -1 <yourusername>
(ubuntu/root) - Ensure password Authentication is enabled (If using SSH).
sudo vi /etc/ssh/sshd_config
- Make sure the following lines are set correctly.
PasswordAuthentication yes
- Restart the SSH Service.
sudo systemctl restart ssh
- Stop the cloud-init service.
sudo systemctl stop cloud-init
- Uninstall cloud-init.
sudo apt purge cloud-init -y
sudo rm -rf /etc/cloud
- Remove cloud-init data and configuration.
sudo rm -rf /var/lib/cloud
sudo sed -i '/cloud-init/d' /etc/default/grub
- Remove any cloud-init entry from the grub.
sudo update-grub
- Reboot the system.
sudo reboot
- Create own password.
-
Stop The VM from the Apiculus portal and create a Root snapshot of that VM.
-
Create Image using the Snapshot. (After creation, it will be visible in the My Image section).
-
Navigate to the VPC section, purchase an IPv4 address, and create a load balancing rule using the acquired IPv4 address.
-
Create the Auto Scale Group using the custom template (My Image).
-
You can now log in to the initial VM using the static password (the same one used for the standard VM). Additionally, you can successfully log in to the secondary VM using the same static password.