Env
ID1=admin PW1=... echo $PW1 > pass.txt ID2=monitor PW2=... IP=192.168.0.12
Error
# ipmitool -I lanplus -H $IP -U $ID1 -P $PW1 lan print 1 Error: Unable to establish IPMI v2 / RMCP+ session
Solution
# sshpass -f pass.txt ssh -o StrictHostKeyChecking=no -t $ID1@$IP << EOF racadm set iDRAC.IPMILan.PrivLimit 4 racadm set iDRAC.IPMILan.Enable 1 racadm set iDRAC.Users.2.IpmiLanPrivilege 4 racadm set iDRAC.Users.2.IpmiSerialPrivilege 4 racadm set iDRAC.Users.3.SolEnable Enabled racadm set iDRAC.Users.3.UserName $ID2 racadm set iDRAC.Users.3.Password $PW2 racadm set iDRAC.Users.3.Enable Enabled racadm set iDRAC.Users.3.Privilege 0x1 racadm set iDRAC.Users.3.IpmiLanPrivilege 2 racadm set iDRAC.Users.3.IpmiSerialPrivilege 2 racadm set iDRAC.Users.3.SolEnable Enabled EOF
REF
Configuring IPMI Over LAN Using RACADM