Changing passwords in Nutanix

There are a LOT of passwords in the Nutanix environment. To make the password changes easy and quick, follow these steps.

1. SSH into a CVM in the affected cluster
2. Run the following command to change the CVM Nutanix password:
sudo passwd nutanix
3. Change the nutanix password
4. Run the following command to change the password for the root account:
echo -e "CHANGING ALL AHV HOST ROOT PASSWORDS.\nPlease input new password: "; read -rs password1; echo "Confirm new password: "; read -rs password2; if [ "$password1" == "$password2" ]; then for host in $(hostips); do echo Host $host; echo $password1 | ssh root@$host "passwd --stdin root"; done; else echo "The passwords do not match"; fi
5. Run this command to change the pasword for the node admin account:
echo -e "CHANGING ALL AHV HOST ADMIN PASSWORDS.\nPlease input new password: "; read -rs password1; echo "Confirm new password: "; read -rs password2; if [ "$password1" == "$password2" ]; then for host in $(hostips); do echo Host $host; echo $password1 | ssh root@$host "passwd --stdin admin"; done; else echo "The passwords do not match"; fi
Run the following command to change the node nutanix account:
echo -e "CHANGING ALL AHV HOST NUTANIX PASSWORDS.\nPlease input new password: "; read -rs password1; echo "Confirm new password: "; read -rs password2; if [ "$password1" == "$password2" ]; then for host in $(hostips); do echo Host $host; echo $password1 | ssh root@$host "passwd --stdin nutanix"; done; else echo "The passwords do not match"; fi
6. Run the commands below to update the admin account in PC and PE:
ncli user reset-password user-name='admin' password='NEW PASS HERE'

Leave a Reply