aboutsummaryrefslogtreecommitdiff
path: root/modules/base_installation
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-10-19 16:12:50 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-10-19 16:12:50 +0200
commitb3ac23bb9960207194de901275f33a72b0779690 (patch)
treefdf055e37a86a4987885cef8e74f86ec4187a9bf /modules/base_installation
parentf7ef7ce7f8d596d38739c5e96623e8630e1036ae (diff)
downloadPuppet-b3ac23bb9960207194de901275f33a72b0779690.tar.gz
Puppet-b3ac23bb9960207194de901275f33a72b0779690.tar.zst
Puppet-b3ac23bb9960207194de901275f33a72b0779690.zip
Add ldap ssha script
Diffstat (limited to 'modules/base_installation')
-rwxr-xr-xmodules/base_installation/files/scripts/ldap_ssha13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/base_installation/files/scripts/ldap_ssha b/modules/base_installation/files/scripts/ldap_ssha
new file mode 100755
index 0000000..cdbea1b
--- /dev/null
+++ b/modules/base_installation/files/scripts/ldap_ssha
@@ -0,0 +1,13 @@
1#! /usr/bin/perl
2use strict;
3use Digest::SHA qw(sha1);
4use MIME::Base64;
5
6print 'Password: ';
7system ( "stty -echo");
8my $secret = <STDIN>;
9chomp $secret;
10my $salt;
11$salt .= ('.','/',0..9,'A'..'Z','a'..'z')[rand 64] foreach(1..8);
12
13print "\nHashed string for LDAP:\nuserPassword: {SSHA}" . encode_base64(sha1($secret . $salt) . $salt, '') . "\n";