Create MD5 Encrypted Passwords
When creating automated ESX Server builds or batch creating users we need to present the user name and password. The useradd command will only accept MD5 encrypted stings and it's not a good idea to put clear text root passwords in the ks.cfg, so the tricky bit is creating an MD5 encrypted user password.
What does an MD5 encrypted password look like? Here's an example of the word 'password' that's been encrypted:
$1$X7vb2M8s$Gj94FO8ffFOQvLuGPk2vp.
So how do we do this?
There are a couple of options:
- Run the ESX scripted install wizard and fill in the bit which asks for the root password with the password for the user you want to create. Once the wizard completes you can open the ks.cfg file and copy the encrypted string into your script or other ks.cfg files. The only trouble with this is that you have to run through the wizard each time and it can be a bit time consuming if you need to create multiple passwords.
- A second option is to use a program like htpasswd. If you are using Linux it may already be installed, but if not, you can usually find it here: http://rpm.pbone.net/ and search for htpasswd, then download and install the rpm which matches your distribution. For Windows there is an equivalent htpasswd.exe but it only produces the Apache version of MD5 encryption.
- Use the openssl tool included in the ESX distribution
The syntax for using the ESX openssl tool is:
openssl passwd -1 <password>
and you'll get a result like this:
$1$X7vb2M8s$Gj94FO8ffFOQvLuGPk2vp.
Copy the bit from the '$' to the '.' inclusive, Here is the finished result when using in a script
useradd -c "auser" -G agroup -p $1$X7vb2M8s$Gj94FO8ffFOQvLuGPk2vp.
- Nil
- MD5 Encrypted Password Generator (Download), http://xtravirt.com/xd10097
Spotlight:
VMware Documentation Downloader v11.08.30
Updated for vSphere 5 - A free tool for those on the move who need information FAST
vSphere 5 License Entitlement Changes
See what has changed in the license entitlement in vSphere 5?
Thin Client vs Zero Client
The differences between Thin and Zero desktop clients for VDI
