On Tue, 26 Oct 2004, Thomas T. Veldhouse wrote:

> Thanks.  It turns out what I needed was actually something different. 
> I needed the output of the crypt function, and for that, I used perl :-)
>
> perl -le 'print crypt("password", "ab");'
>
> where "ab" are any two random characters.
>
> [veldy at fuggle veldy]$ perl -le 'print crypt("password", "ab");'
> abJnggxhB/yWI


Note that "ab" are the first two characters of the putatively encrypted 
output.  It seems that your perl command always includes the first two 
letters of the input as the first two letters of the output:

# perl -le 'print crypt("password", "joe");'
jobbj4Fd7EAng
# perl -le 'print crypt("password", "bob");'
boCXLU4aKrJ0Y
# perl -le 'print crypt("password", "mary");'
maC0ec.kN8AgI

That can't be right!  Also, I do not find a match between the output of 
this command, using my password as input, with my line in my /etc/shadow 
file.  I am using Solaris - does it not use the same password encryption 
as Linux?  I don't have read permissions on /etc/shadow on a Linux box, so 
I can't check.

According to "man useradd" on Linux:

   -p passwd
       The encrypted password, as returned by crypt(3).  The default is
       to disable the account.

I really want to figure out how to generate the correct 'passwd' string 
for this command.  Whatever one enters as 'passwd' is *exactly* what is 
entered in the password field of /etc/shadow.  Thus, it would be really 
nice for generating new user accounts to have this working.

Mike

_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
Help beta test TCLUG's potential new home: http://plone.mn-linux.org
Got pictures for TCLUG? Beta test http://plone.mn-linux.org/gallery
tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list