Generating /etc/shadow passwords

If you want to generate shadow passwords (e.g. to be used in "useradd -p"):

openssl passwd -1 -salt 'sUktuv56' 'somePa55w0rd'
# This will give you '$1$sUktuv56$lbUdWixmJBKNsi4r2XEN91'

For more information on the openssl parameters, see "openssl passwd –help".

Oh, and in case you need to decode a shadow password entry, here’s how:

$1$sUktuv56$lbUdWixmJBKNsi4r2XEN91
 ^ ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
 | |        |- The password hash
 | |- Salt
 |- Hash type - in this case, it's md5
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: