ADVERTISE HERE

Create MD5 Encrypted Passwords

Title: Create MD5 Encrypted Passwords
Author(s): Xtravirt (Gavin Jolliffe)
Target Audience: Technical - Novice
Current Revision: 1.0 March 2009
First Published: 2 March 2009
Products: VMware ESX Server
UID: XD10083
Information
Title: 
Create MD5 Encrypted Passwords
Author(s): 
Xtravirt (Gavin Jolliffe)
Target Audience: 
Technical - Novice
First Published: 
2 March 2009
Products: 
VMware ESX Server
UID: 
XD10083

How to create MD5 encrypted passwords suitable for VMware ESX Server.

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:

  1. 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.
  2. 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.
  3. 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.

References
References: 
  1. Nil
References
  1. Nil
Tags
cmd
create
encrypt
ESX
md5
openssl
passwd
password
VMware
Hypervisor
Security

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

Technology Exchange: