Accessing and Controlling Your HP ProLiant Servers with SSH and Plink
As lab administrators, we are always looking for ways to automate and streamline our workflows, especially when it comes to managing our server infrastructure. In this blog post, we will explore how to access and control your HP ProLiant servers with SSH and Plink, a powerful and versatile tool that allows us to send commands via SSH.
Background and Inspiration
Recently, Frank Denneman wrote a short blog post about accessing his Supermicro IPMI with SSH. He used this access to power on his lab servers. While I don’t use Supermicro boards in my lab, I do have four HP ProLiants with iLO (Integrated Lights-Out), which also has a SSH interface. This method of powering on my servers seemed very practical, especially because the iLO web interface isn’t the fastest. However, I wanted it to be a bit more automated, so I decided to use Plink to send commands via SSH.
Creating a New User Account for SSH Access
To start, we need to create a new user account in the iLO user database. This user will have only the rights to change the power state of the server. To do this, log in to the iLO web interface, click on “Administration,” then “User Administration” and “New.” Fill in the required fields, including a password, even if you plan to login with SSH public key authorization later.
Once you have created the new user account, we need to import the SSH key pair. To do this, log in to the iLO web interface again, click on “Administration,” then “Security” in the “Settings” area on the left. Click “Browse…” and select the text file with the SSH public key.
Importing the SSH Key
The key that is shown in the “Key” area of the PuTTY Key Generator differs from the saved public key. Both are public keys, but they have a different format. You have to import the key that is shown in the “Key” area. If you have imported the right key, the key is automatically assigned to the new user account.
Using Plink to Send Commands via SSH
Now that we have set up SSH access to our HP ProLiant servers, we can use Plink to send commands via SSH. Open a CMD and change to the directory with the Plink executable and the SSH private key. The following commands turn the server on/off:
* To turn on: C:\Program Files (x86)\PuTTY>plink -i sshlogin.ppk sshlogin@ilo-esx1.lab.local “power on”
* To turn off: C:\Program Files (x86)\PuTTY>plink -i sshlogin.ppk sshlogin@ilo-esx1.lab.local “power off”
A warm reset can be requested by using this command:
* C:\Program Files (x86)\PuTTY>plink -i sshlogin.ppk sshlogin@ilo-esx1.lab.local “power warm”
A cold reset can be requested by using this command:
* C:\Program Files (x86)\PuTTY>plink -i sshlogin.ppk sshlogin@ilo-esx1.lab.local “power reset”
You can put these commands into a batch file to power on/off a couple of servers with a single click.
Conclusion
In this blog post, we have explored how to access and control your HP ProLiant servers with SSH and Plink. By creating a new user account in the iLO user database and importing the SSH key pair, we can use Plink to send commands via SSH to power on/off our servers. This method is more automated and efficient than using the iLO web interface, especially when you need to perform multiple actions on multiple servers at once.