[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: password encryption




On Sat, Jun 17, 2000 at 10:31:14AM -0500, Charles Menzes wrote:
> 
> I noticed that for the useradd and usermod apps, in order to use the -p
> <password> option, the password needs to be entered in its already
> encrypted state. Is there any command which can take a password, as typed
> in by a user, and run the crypt function to generate the encrypted passwd
> and return the value as text?

I usually use
 echo password | perl -le 'print crypt($_, DS)'
if I'm in a hurry, where the DS is the salt, and password is the password.

Sometimes I'll put a little time in and use
 echo password | perl -le 'print crypt($_, (A..Z)[rand 25].(A..Z)[rand 25])';
Either way works.

That's what I'm using in my LDAP-enabled useradd, usermod, and passwd programs...

--Danny

--
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.