#!/usr/bin/perl #Check password encryption $username = shift || die "Usage $0 username plaintext_password\n"; $plaintext = shift || die "Usage $0 username plaintext_password\n"; $encpass = (getpwnam($username))[1]; print "Testing encryption ... "; if (crypt($plaintext, $encpass) ne $encpass) { print "FAILED\nTrying MD5 encryption ... "; if ( eval "use Crypt::PasswdMD5" ) { print "FAILED\n\nCannot try MD5 since Crypt::PasswdMD5 is not inst +alled.\n"; } else { if (&unix_md5_crypt($plaintext, $encpass) ne $encpass) { print "FAILED\n\nUnable to automatically use passwords from your + system.\n"; } else { print "OK\n\nMD5 passwords were detected.\n"; } } } else { print "OK\n"; }
In reply to Re: Passwords on unix
by zentara
in thread Passwords on unix
by sawanv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |