Two ideas for you. First - you could whip something together to take all the existing user:pass hashes in the /etc/passwd or /etc/shadow (wherever your distro puts them) and drop them into a passwd file. Perl and login both use the same crypt scheme to develop those encrypted passwords so verification from there is easy. However this isn't such a hot solution as it requires your web browser having permission to read the passwd file - which means it's similar to posting your /etc/passwd onto the web (or could be similar to...someone would have to find it first). My second idea is to whip together a really quick, really small, suidroot script (I know bad idea - but it's small so it's easy to make secure and it's not going to do anything except read the passwd/shadow file and spit back a 1 or a 0). As I said that script can take input on the command line (the l/p of the user) and can then use that to match against the l/p stored in the existing user account DB (passwd/shadow). Have it return 0 for a failure, 1 for a pass. Call it from your script with backticks and assign the stdout to a variable. Check the variable for a 1 or a 0 and you've got your answer. Without root permissions on the script there are only so many ways out...

-Adam Stanley
Nethosters, Inc.

In reply to Re: Unix Authentication by astanley
in thread Unix Authentication by nick

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.