summaryrefslogtreecommitdiffstats
path: root/rescue/tree/usr/sbin/genpasswd
diff options
context:
space:
mode:
Diffstat (limited to 'rescue/tree/usr/sbin/genpasswd')
-rwxr-xr-xrescue/tree/usr/sbin/genpasswd13
1 files changed, 13 insertions, 0 deletions
diff --git a/rescue/tree/usr/sbin/genpasswd b/rescue/tree/usr/sbin/genpasswd
new file mode 100755
index 000000000..2f129673d
--- /dev/null
+++ b/rescue/tree/usr/sbin/genpasswd
@@ -0,0 +1,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";