diff options
author | Stefan Kangas <stefankangas@gmail.com> | 2010-12-31 00:09:41 +0100 |
---|---|---|
committer | Stefan Kangas <stefankangas@gmail.com> | 2010-12-31 00:09:41 +0100 |
commit | 999461003a84603f188d69a2281c0aa6071fafeb (patch) | |
tree | 3deeb5f80208e8171591ced9fcd4ef5f7155de24 /fripost-mkpass.pl | |
parent | 7a718391b4f8ec8e85902abb55f3511db7eecb59 (diff) |
Automatic password generation for new users
Diffstat (limited to 'fripost-mkpass.pl')
-rwxr-xr-x | fripost-mkpass.pl | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/fripost-mkpass.pl b/fripost-mkpass.pl new file mode 100755 index 0000000..4740f5b --- /dev/null +++ b/fripost-mkpass.pl @@ -0,0 +1,43 @@ +#!/usr/bin/perl + +use 5.010_000; +use warnings; +use strict; + +=head1 NAME + +fripost-mkpass.pl - Create a random new password + +=cut + +our $VERSION = '0.01'; + +use Fripost::Password; +use String::MkPasswd qw/mkpasswd/; + +# Generate password +my $password = mkpasswd( + -length => 20, + -minnum => 5, + -minspecial => 3 +); +$user{password} = smd5($password); + +# Show the information that will be inserted +say "Generated password: $password"; +say "Salted MD5: " . smd5($password); + +=head1 AUTHOR + +Stefan Kangas C<< <skangas at skangas.se> >> + +=head1 COPYRIGHT + +Copyright 2010 Stefan Kangas. + +=head1 LICENSE + +This program is free software; you can redistribute it and/or modify it +under the same terms as perl itself. + +=cut |