summaryrefslogtreecommitdiffstats
path: root/rescue/genpasswd
blob: 2f129673d86b4e99881d868f568a8a7c6cbb0136 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/perl

use strict;

system "stty -echo";
print STDERR "Give a password for ssh access: ";
chomp(my $word = <STDIN>);
print STDERR "\n";
system "stty echo";

my @salt = ('.', '/', 0..9, 'A'..'Z', 'a'..'z')[rand 64, rand 64];
print crypt($word, join('', @salt));
print "\n";