How to create encrypted password via command line

Dag Wieers dag at wieers.com
Wed Sep 12 18:20:33 UTC 2007


On Wed, 12 Sep 2007, Anne Moore wrote:

> Does anyone know of a quick/painless way to create an encrypted {crypt}
> password via the command like on Red Hat? I need my users to do this and I
> don't want them to have to write much syntax, etc., as that will be too much
> for them. I was hoping there was some built-in (or other) method that allows
> creating an encrypted password, depending on what the user types in for the
> password.

How about just doing:

	openssl passwd -crypt

then you can automate it by doing:

	echo test | openssl passwd -crypt -stdin

and you can even provide the salt, just to verify a password:

	echo test | openssl passwd -crypt -stdin -salt ab

Other possibilities are MD5 and Apache MD5 encryption.

-- 
--   dag wieers,  dag at wieers.com,  http://dag.wieers.com/   --
[Any errors in spelling, tact or fact are transmission errors]




More information about the redhat-list mailing list