ldifs/30.root.ldif.sh

38 lines
788 B
Bash
Raw Normal View History

2018-03-29 21:44:11 +02:00
#!/bin/sh -e
basedn=$(cat basedn)
_x=${basedn%%,*}
dc=${_x#*=}
pw=`pwgen 8 1`
echo "# Password for cn=root,$basedn: $pw" >&2
cat <<EOF
dn: $basedn
objectClass: top
objectClass: dcObject
objectClass: organization
2018-03-29 23:03:10 +02:00
dc: $dc
o: $dc
2018-03-29 21:44:11 +02:00
structuralObjectClass: organization
dn: cn=root,$basedn
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: root
description: LDAP administrator
userPassword:: `/usr/sbin/slappasswd -h '{CRYPT}' -c '$5$rounds=8000$%.16s' -s "$pw" | base64 -w0`
2018-03-29 21:44:11 +02:00
structuralObjectClass: organizationalRole
dn: ou=People,$basedn
objectClass: top
objectClass: organizationalUnit
structuralObjectClass: organizationalUnit
ou: People
dn: ou=Groups,$basedn
objectClass: top
objectClass: organizationalUnit
structuralObjectClass: organizationalUnit
ou: Groups
EOF