Hi All,
I need to authenticate user passwords on ubuntu server. I need to do this repeatedly and in bulk so I'm looking for a fast simple and lightweight method.
What am I doing wrong here?
# line taken from /etc/shadow
# fred:$6$ENtbbZ8/$dToEo6ohB/AjHGHhwsPXk0rsIXA/XmFaeUNJHnrBWoLqjX12rjUWLBTkkD9sH7pP4IrEsRMeB4/WMnQGPKJSJ/:14929:0:99999:7:::
my $hash = '$ENtbbZ8/$dToEo7hnr/AjHGHhwsPXk0rsIXA/XmFaeUNJHnrBWoLqjX12rjUWLBTkkD9sH7pP4IrEsRMeB4/WMnQGPKJSJ/';
my $salt = '$6';
my $password = "this_is_my_password";
if (crypt($password, $salt) ne $hash) {
print "Password doesn't match";
}
else{
print "Password does match"
}
ps. names and hashes have been changed to protect the innocent. - ie these aren't real values.