Installation & Configuration

Welcome to the Nutanix NEXT community. To get started please read our short welcome post. Thanks!

cancel
Showing results for 
Search instead for 
Did you mean: 

Change all CVM/IPMI passwords

Highlighted
Explorer

Change all CVM/IPMI passwords

Hello

 

I don't know if this will be useful for anyone but I came up with a few command lines to change the default passwords for the CVM and IPMI users  and create a new user to mimic the dell DRAC's user 

 

#change IPMI password
for i in `hostips`; do ssh root@$i 'for id in `/ipmitool user list |grep 'ADMIN '|cut -d" " -f1`;do echo $id;/ipmitool user set password $id <password>;done' ; done
for i in `ncli host list | grep -E 'ID ' | cut -d":" -f4`; do ncli host edit id=$i ipmi-password=<password>; done

 

#create root user on all nodes ipmi to keep consitant with Dell Drac
for i in `hostips`; do ssh root@$i '/ipmitool user set name 3 root;/ipmitool user set password 3 <password>; /ipmitool user priv 3 4;/ipmitool channel setaccess 1 3 privilege=4;/ipmitool user enable 3' ; done

 

# change esxi password
for i in `hostips`;do echo "--$i--";ssh root@$i 'echo -e "<password>\n<password>" | passwd';done

 

#change cvm password
for i in `svmips`;do echo "--$i--";ssh nutanix@$i 'echo -e "<password>\n<password>" | sudo passwd nutanix';done

 

7 REPLIES
Community Manager

Re: Change all CVM/IPMI passwords

Thanks for sharing @MarkJ 

Tags (1)
Nutanix Employee

Re: Change all CVM/IPMI passwords

Hi! Super scripts, thanks for sharing.

 

I just used the IPMI script on a dell XC cluster (ESX6 / AOS 4.7.2) and had to slightly modify the script to the below.

 

for i in `hostips`; do ssh root@$i 'for id in `/ipmitool user list 1|grep 'root '|cut -d" " -f1`;do echo $id;/ipmitool user set password $id <password>;done' ; done

for i in `ncli host list | grep -E 'Id ' | cut -d":" -f4`; do ncli host edit id=$i ipmi-password=<password>; done

 

Thanks!

Adventurer

Re: Change all CVM/IPMI passwords

Thanks for sharing this, this was on my to do list and you just saved me a nice chunk of time.

Pathfinder

Re: Change all CVM/IPMI passwords

Mark,

I'm not familiar with those commands.  What scripting language are you running those commands from?

Nutanix Employee

Re: Change all CVM/IPMI passwords

Run it from the CVM CLI.

Scout

Re: Change all CVM/IPMI passwords

Hi

How would you that when one cannot SSH. OR no longer remember the password of the CVM.

Outrider

Re: Change all CVM/IPMI passwords

@rajch Do you mean you could not make SSH connections to all CVM because you could not remember the CVM password?

 

There are 2 ways to connect to CVM, one via host -> 192.168.5.0 network and second is via CVM outside IP Address.

 

If you could not make it run in both ways, you can leverage the Prism to do that (follow the KB 2233 on Nutanix Portal)