BMC添加带外用户

#!/bin/bash
USER='root'
PASS='calvin'
HPASS='12345678'
CHANNEL=1
USERID=4
#ty=`ipmitool fru list|grep 'Product Manufacturer'|grep -i "hp"|uniq -c|awk -F: '{print $2}'`
ty=`dmidecode -s system-manufacturer`
if [ $ty == "HP" ]
then
CHANNEL=2
ipmitool user set name $USERID $USER

ipmitool user set password $USERID $HPASS 

ipmitool user priv $USERID 4 $CHANNEL

ipmitool user enable $USERID

ipmitool user list $CHANNEL
fi
echo $CHANNEL
exit 0

ipmitool user set name $USERID $USER

ipmitool user set password $USERID $PASS 

ipmitool user priv $USERID 4 $CHANNEL

ipmitool user enable $USERID

ipmitool user list $CHANNEL

ipmitool -I open channel setaccess   $CHANNEL   $USERID callin=on ipmi=on link=on privilege=4  # add privilege



HP 密码有长度限制

你可能感兴趣的:(BMC添加带外用户)