adding IPMI user in commandline

#!/bin/sh
# execute on jumphost
#
# default user per manufacturer
# Dell :  root/calvin
# Oracle: root/changeme

# HP iLO default channel seems to be "2" not "1"
# you can verify 'ipmitool channel getaccess <channel number> [user id]'
   
IF="lan"        # interface might be lan or lanplus
U="root"
P="calvin"
CHANNEL="1"
SN="192.168.0."
SIP="101"
EIP="111"
ID="3"          # choose any empty entry
NAME="myid"
PASSWD="mypasswd"
OPTION="link=on ipmi=on callin=on privilege=4"

sudo ipmitool user set name $ID $NAME
sudo ipmitool user set password $ID $PASSWD
sudo ipmitool channel setaccess $CHANNEL $ID $OPTION
sudo ipmitool user enable $ID
sudo ipmitool user list $CHANNEL

for i in `seq $SIP $EIP`; do
        sudo ipmitool -I $IF -U $U -P $P -H $SN$i user set name $ID $NAME
        sudo ipmitool -I $IF -U $U -P $P -H $SN$i user set password $ID $PASSWD
        sudo ipmitool -I $IF -U $U -P $P -H $SN$i channel setaccess $CHANNEL $ID $OPTION
        sudo ipmitool -I $IF -U $U -P $P -H $SN$i user enable $ID
        sudo ipmitool -I $IF -U $U -P $P -H $SN$i user list
done

Leave a Reply

Your email address will not be published. Required fields are marked *