-
Notifications
You must be signed in to change notification settings - Fork 0
/
instructions.txt
84 lines (60 loc) · 2.5 KB
/
instructions.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
Given a modern RPM based Linux distribution and OpenLDAP > v??
Assumes systemd (systemctl), vary for upstart (service,chkconfig,/etc/init.d)
Configuration by otc (online ?? configuration?)
openldap-servers
openldap-clients
cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
systemctl
sudo systemctl start slapd
sudo ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// -b cn=config dn
sudo ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// -b cn=config olcDatabase=hdb
slappasswd
{SSHA}3vzCpXUGXduJwII8gx0V/M2g/2jL2wq1
--- config_customize_db.ldif
dn: olcDatabase=hdb,cn=config
relace: olcSuffix
olcSuffix: dc=example,dc=com
-
replace: olcRootDN
olcRootDN: cn=Manager,dc=example,dc=com
-
add: olcRootPW
olcRootPW: {SSHA}3vzCpXUGXduJwII8gx0V/M2g/2jL2wq1
sudo ldapmodify -Q -Y EXTERNAL -H ldapi:/// -f config_customize_db.ldif
sudo ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// -b cn=config olcDatabase=hdb
convert_dhcp_schema.conf
include /etc/openldap/schema/dhcp.schema
mkdir -p ldif_output
slapcat -f /vagrant/convert_dhcp_schema.conf -F ldif_output -n0 -H ldap:///cn={0}dhcp,cn=schema,cn=config -l dhcp.ldif
sed -i -e '/CRC32/d ; s/{0}dhcp/dhcp/ ; /structuralObjectClass/,$d' dhcp.ldif
cat <<EOF > /tmp/slapd.conf-dhcp
include /etc/openldap/schema/dhcp.schema
EOF
mkdir -p /tmp/ldif_output
slapcat -f /tmp/slapd.conf-dhcp -F /tmp/ldif_output -n0 -H ldap:///cn={0}dhcp,cn=schema,cn=config | sed -e '/CRC32/d ; s/{0}dhcp/dhcp/ ; /structuralObjectClass/,$d' > /etc/openldap/schema/dhcp.ldif
rm -rf /tmp/ldif_output
rm /tmp/slapd.conf-dhcp
# add
sudo ldapadd -Q -Y EXTERNAL -H ldapi:/// -f cosine.ldif
#sudo ldapadd -Q -Y EXTERNAL -H ldapi:/// -f nis.ldif
#sudo ldapadd -Q -Y EXTERNAL -H ldapi:/// -f inetorgperson.ldif
sudo ldapadd -Q -Y EXTERNAL -H ldapi:/// -f dhcp.ldif
--- example.com.ldif
dn: dc=example,dc=com
objectClass: top
objectClass: domain
dc: example
description: Example network to contain DHCP servers
ldapadd -x -w oracle -D cn=Manager,dc=example,dc=com -H ldapi:/// -f /vagrant/example.com.ldif
# add dhcp server host
-- dhcp1.example.com
dn: dc=dhcp1,dc=example,dc=com
objectClass: dhcpServer
dc: dhcp1
description: The example DHCP server
perl /usr/share/doc/dhcp/ldap/dhcpd-conf-to-ldap --conf example-dhcpd.conf --ldif example-dhcpd.ldif --basedn dc=example,dc=com --server dhcpd --dhcpdn "cn=DHCP Config,dc=example,dc=com"
Creating LDAP Configuration with the following options:
Base DN: dc=example,dc=com
DHCP DN: cn=DHCP Config2,dc=example,dc=com
Server DN: cn=dhcpd, dc=example,dc=com
Done.