Generate encrypted passwords using openssl

Moderator: cah

Post Reply
cah
General of the Army / Fleet Admiral / General of the Air Force
General of the Army / Fleet Admiral / General of the Air Force
Posts: 1336
Joined: Sun Aug 17, 2008 5:05 am

Generate encrypted passwords using openssl

Post by cah »

It is convenient to generate encrypted passwords from command line without prompt.

Here is a useful command to use openssl to generate MD5 passwords.

Code: Select all

echo '<PWD>' | openssl passwd -1

Code: Select all

-1                 MD5-based password algorithm
-apr1              MD5-based password algorithm, Apache variant

Example:

Code: Select all

echo 'testpwd' | openssl passwd -1 -stdin
$1$Ei/7/eUx$4b7R85DMjEbiEa/4m7YG5/

echo 'testpwd' | openssl passwd -apr1 -stdin
$apr1$pOyUUu0L$bzaZpE.9pGKk0ZApkFGaP/

CAH, The Great
Post Reply