Skip to main content

Using Static Password In Autoscale Group’s Instance

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