Browse Source

Prepare openldap to work with lowry (lastbind module and password format) and setup demo users to don't be locked or deleted on testing.

setup_test
pebles 1 year ago
parent
commit
c6cdbcdb3a
Signed by: pebles
GPG Key ID: 4501C52A9268B49C
  1. 4
      Makefile
  2. 4
      examples/data.ldif
  3. 6
      examples/lastbind-module-enable.ldif
  4. 6
      examples/lastbind-module-load.ldif
  5. 8
      examples/passwd-format.ldif
  6. 5
      examples/sample-users-first-login.sh

4
Makefile

@ -22,7 +22,11 @@ deps:
fixtures:
sudo cp examples/sindominio.* /etc/ldap/schema/
sudo ldapadd -Y EXTERNAL -H ldapi:// -f /etc/ldap/schema/sindominio.ldif
sudo ldapmodify -Y EXTERNAL -H ldapi:// -f examples/passwd-format.ldif
sudo ldapmodify -Y EXTERNAL -H ldapi:// -f examples/lastbind-module-enable.ldif
sudo ldapadd -Y EXTERNAL -H ldapi:// -f examples/lastbind-module-load.ldif
sudo slapadd -n 1 -l examples/data.ldif
sudo $(shell examples/sample-users-first-login.sh)
demo:
./lowry -config examples/lowry.conf

4
examples/data.ldif

@ -12,7 +12,7 @@ objectClass: shadowAccount
objectClass: sdPerson
objectClass: top
sdRole: amiga
userPassword: {SSHA}FHqod3gytvH9MDGhpMV1DKjyU7eO1EDG
userPassword: {CRYPT}$6$$p0Hh2EoSEDPBIwNrVnlnl4hs2B8uY76fu87IXlC2CFoPwJlzY8nA1Hv/n5ykGE1oYlTg.LKjtUcbkHkkwA4ny/
loginShell: /bin/bash
uidNumber: 1000
gidNumber: 1000
@ -29,7 +29,7 @@ objectClass: shadowAccount
objectClass: sdPerson
objectClass: top
sdRole: sindominante
userPassword: {SSHA}FHqod3gytvH9MDGhpMV1DKjyU7eO1EDG
userPassword: {CRYPT}$6$$p0Hh2EoSEDPBIwNrVnlnl4hs2B8uY76fu87IXlC2CFoPwJlzY8nA1Hv/n5ykGE1oYlTg.LKjtUcbkHkkwA4ny/
loginShell: /bin/bash
uidNumber: 1001
gidNumber: 1001

6
examples/lastbind-module-enable.ldif

@ -0,0 +1,6 @@
# Enable module lastbind
# ldapmodify -Y EXTERNAL -H ldapi:///
dn: cn=module{0},cn=config
add: olcModuleLoad
olcModuleLoad: {0}lastbind

6
examples/lastbind-module-load.ldif

@ -0,0 +1,6 @@
# Config slapd to use lastbind overlay:
# ldapadd -Y EXTERNAL -H ldapi:///
dn: olcOverlay={0}lastbind, olcDatabase={1}mdb,cn=config
objectClass: olcLastBindConfig
olcOverlay: {0}lastbind

8
examples/passwd-format.ldif

@ -0,0 +1,8 @@
# ldapmodify -Y EXTERNAL -H ldapi:///
dn: cn=config
add: olcPasswordHash
olcPasswordHash: {CRYPT}
-
add: olcPasswordCryptSaltFormat
olcPasswordCryptSaltFormat: $6$%.16s

5
examples/sample-users-first-login.sh

@ -0,0 +1,5 @@
# Login to ldap so authTimestamp exists before first run.
ldapsearch -D 'uid=user,ou=People,dc=nodomain' -w foobar -b 'uid=user,ou=People,dc=nodomain'
ldapsearch -D 'uid=superuser,ou=People,dc=nodomain' -w foobar -b 'uid=superuser,ou=People,dc=nodomain'
ldapsearch -D 'uid=pebles,ou=People,dc=nodomain' -w foobar -b 'uid=pebles,ou=pebles,dc=nodomain'
Loading…
Cancel
Save