[plug] Passwords

Russell Steicke r.steicke at bom.gov.au
Sat Mar 9 23:22:11 WST 2002


On Sat, Mar 09, 2002 at 10:57:03PM +0800, Adrian Woodley wrote:
> I had a look at /etc/shadow on my first attempt, but couldn't work out what
> to put in the password field. Any suggestions?

Originally I thought an empty field would do it, but no.  So this
whipped-up C program will MD5-encrypt an empty string.  Cut and paste
that string in to /etc/shadow.  I just tried it, and it works.  You may
want to replace "abcdefgh" in the salt parameter to something less
obvious.  See crypt(3).

This could probably be done in half a line of perl. :)



#include <stdio.h>
#include <crypt.h>

int main()
{
        printf("Empty crypted password: \"%s\"\n",
                        crypt("", "$1$abcdefgh"));
}




-- 
Russell Steicke

-- Fortune says:
It's all magic.  :-)
             -- Larry Wall in <7282 at jpl-devvax.JPL.NASA.GOV>



More information about the plug mailing list