VMware Cloud Community
armstrongn
Contributor
Contributor

Creating encrypted ROOT password in ks.cfg

Hi all,

How do you create the encrypted password within the ks.cfg, is have a the default sample ks.cfg which has :

\# root password

\# The MD5 encrypted string below is for "password"

rootpw --iscrypted $1$XoNAfIU3$9ZvhBFDJ3o8QMnfgnjPpB0

Now how do I create my own MD5 encrpyted password.

I have done it in 2.x in the past via using the Source CD, but there is nothing for 3.x

Can anyone help.

Message was edited by:

armstrongn

Reply
0 Kudos
7 Replies
bister
Expert
Expert

Use the Skripted Installation Link on you ESX Host (http://ip-or-hostname-of-esx). That will create a sample ks.cfg with the encrypted password.

Reply
0 Kudos
steve_c
Contributor
Contributor

Download the openssl light toolkit from the link below. A quick read of the doco will have knocking out encrypted passwords in no time.

http://www.slproweb.com/products/Win32OpenSSL.html

Reply
0 Kudos
virtech
Expert
Expert

Run this command from the service console:

Create new MD% password

/sbin/grub-md5-crypt

Reply
0 Kudos
bertdb
Virtuoso
Virtuoso

perl can do this on the command line as well:

perl -e '@az=("a".."z","0".."9","A".."Z"); print crypt("SecretPassword","\$1\$".$az\[rand 61].$az\[rand 61].$az\[rand 61].$az\[rand 61].$az\[rand 61].$az\[rand 61].$az\[rand 61].$az\[rand 61])."\n"'

(replace SecretPassword by your own password of choice).

or

perl -e 'print crypt("SecretPassword","\$1\$vbFGrt45")."\n"'

where you vary the vbFGrt45 string manually to generate different salts for different hosts.

Reply
0 Kudos
jose_maria_gonz
Virtuoso
Virtuoso

No offense, but I think there is an easier way to do it by leveraging openssl (included in ESX).

Add a user in the ks.cfg with the following command:

/usr/sbin/useradd username

/usr/sbin/usermod -p '

Then make the encrypted password with this command from the COS:

\[root@esx1 root]# openssl passwd -1

Password:

Verifying - Password:

$1$dSkCAWDj$2TKDuGPWN0iFJqtSV6pTh1[/b] (This is the encrypted password)

Reply
0 Kudos
virtech
Expert
Expert

Wasn't my way easy enough?

Reply
0 Kudos
jose_maria_gonz
Virtuoso
Virtuoso

Sure mooihoek, more than enough,

rgds,

J.

Reply
0 Kudos