summaryrefslogtreecommitdiffstats
path: root/rescue/tree/usr/sbin/genpasswd
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2013-12-02 23:40:22 +0000
committerColin Guthrie <colin@mageia.org>2013-12-07 18:32:06 +0000
commite7aedc3aa7e08f3337c86085c6da10ca83445024 (patch)
tree4005be196198d60c655e345d43fef926bbac6702 /rescue/tree/usr/sbin/genpasswd
parent2ad4c4fc0b990dd0db23cdee815ac2a13c60929d (diff)
downloaddrakx-e7aedc3aa7e08f3337c86085c6da10ca83445024.tar
drakx-e7aedc3aa7e08f3337c86085c6da10ca83445024.tar.gz
drakx-e7aedc3aa7e08f3337c86085c6da10ca83445024.tar.bz2
drakx-e7aedc3aa7e08f3337c86085c6da10ca83445024.tar.xz
drakx-e7aedc3aa7e08f3337c86085c6da10ca83445024.zip
rescue: Move files around and introduce proper dep tracking.
This moves any perl files into bin and sbin folders which will be directly installed in /usr/bin and /usr/sbin. This is done such that the extract modes in list.xml still work and the files end up in the right places. All other files have been moved into the tree folder in their final destination.
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";