summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrescue/genpasswd7
1 files changed, 5 insertions, 2 deletions
diff --git a/rescue/genpasswd b/rescue/genpasswd
index b7fe1f660..2f129673d 100755
--- a/rescue/genpasswd
+++ b/rescue/genpasswd
@@ -1,10 +1,13 @@
#!/usr/bin/perl
+use strict;
+
system "stty -echo";
print STDERR "Give a password for ssh access: ";
-chomp($word = <STDIN>);
+chomp(my $word = <STDIN>);
print STDERR "\n";
system "stty echo";
-print crypt($word, join('', ('.', '/', 0..9, 'A'..'Z', 'a'..'z')[rand 64, rand 64]));
+my @salt = ('.', '/', 0..9, 'A'..'Z', 'a'..'z')[rand 64, rand 64];
+print crypt($word, join('', @salt));
print "\n";