Install dlap server : apt install slapd ldap-utils
It would need to be setup password after first install
Configure slapd : dpkg-reconfigure slapd
Omit OpenLDAP server configuration? No
DNS domain name: tumaz.gpucluster.calab
Organization name? gpucluster.calab
Administrator password: PASSWORD
Confirm password: PASSWORD
Database backend to use: MDB
Do you want the database to be removed when slapd is purged? No
Move old database? Yes
Add the file to database ldapadd -x -W -D "cn=admincalab,dc=tumaz,dc=gpucluster,dc=calab" -f ./ou.ldif
Returns:
adding new entry "cn=Manager,dc=tumaz,dc=gpucluster,dc=calab"
adding new entry "ou=People,dc=tumaz,dc=gpucluster,dc=calab"
adding new entry "ou=Group,dc=tumaz,dc=gpucluster,dc=calab"
Use the ldapmodify command to tell slapd about our TLS work via the slapd-config database:
ldapmodify -Y EXTERNAL -H ldapi:/// -f certinfo.ldif
12.edit /etc/default/slapd and include ldaps:/// in SLAPD_SERVICES
Progress
pacific
join LDAPLDAP
usersprojectV
usersInstalltion and setup process
Tumaz
Install dlap server :
apt install slapd ldap-utils
Configure slapd :
dpkg-reconfigure slapd
Check port 389 is opened :
ss -tlnp | grep slapd
Edit Manager info
slappasswd
Create a file 'basedn.ldif' with content:
ldapmodify -Y EXTERNAL -H ldapi:/// -f basedn.ldif
grep olcRootDN /etc/ldap/slapd.d/cn\=config/olcDatabase\=\{1\}mdb.ldif
Add necessary schema
Check
slaptest -u
Add user and group nodes to database
Create 'ou.ldif' with content:
ldapadd -x -W -D "cn=admincalab,dc=tumaz,dc=gpucluster,dc=calab" -f ./ou.ldif
Add linux users information to database ref. https://kb.brightcomputing.com/knowledge-base/how-can-i-migrate-system-users-to-ldap/
migrationtools
:apt install migrationtools
/usr/share/perl5/migrate_common.ph
:Modify
/usr/share/migrationtools/migrate_passwd.pl
/etc/passwd
and/etc/group
to local file,user
andgroup
.user
andgroup
to ldif filesuser.ldif
andgroup.ldif
mail
items to user emails in '()'cn
andsn
items the same asuid
Set up TLS for LDAP server
apt install gnutls-bin ssl-cert
certtool --generate-privkey --bits 4096 --outfile /etc/ssl/private/mycakey.pem
/etc/ssl/ca.info
to define the CA:certtool --generate-self-signed --load-privkey /etc/ssl/private/mycakey.pem --template /etc/ssl/ca.info --outfile /usr/local/share/ca-certificates/mycacert.crt
update-ca-certificates
certtool --generate-privkey --bits 2048 --outfile /etc/ldap/ldap01_slapd_key.pem
/etc/ssl/tumaz.gpucluster.calab.info
:certtool --generate-certificate --load-privkey /etc/ldap/ldap01_slapd_key.pem --load-ca-certificate /etc/ssl/certs/mycacert.pem --load-ca-privkey /etc/ssl/private/mycakey.pem --template /etc/ssl/ldap01.info --outfile /etc/ldap/ldap01_slapd_cert.pem
certinfo.ldif
:ldapmodify -Y EXTERNAL -H ldapi:/// -f certinfo.ldif
12.edit/etc/default/slapd
and includeldaps:///
inSLAPD_SERVICES
systemctl restart slapd
Install samba tools:
apt install samba smbldap-tools
samba.ldif
to SLAP :ldapadd -Q -Y EXTERNAL -H ldapi:/// -f /usr/share/doc/samba/examples/LDAP/samba.ldif
ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// -b cn=schema,cn=config 'cn=*samba*'
samba_indices.ldif
with content:samba_indices.ldif
toslap
:ldapmodify -Q -Y EXTERNAL -H ldapi:/// -f samba_indices.ldif
Pacific
Contral Panel
>LDAP
>Server Address
: 192.168.0.149 >Next
detail
>use CIFs code
>Done