Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Generate htpasswd compatible password.
use strict;
chomp(my $filename=$ARGV[0]);
chomp(my $username=$ARGV[1]);
chomp(my $password=$ARGV[2]);
if (!$filename || !$username || !$password) {
print "USAGE: ./ filename username password\n\n";
} else {
open FILE, ">>", $filename or die $!;
print FILE $username . ":" . crypt($password, $username) . "\n";
close FILE or die $!;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.