I added an attribute to my LDAP database by running
ldapmodify -QY EXTERNAL -H ldapi:/// -f openssh-lpk.schema
as root, where openssh-lpk.schema
contains this:
# Author: Eric AUGE <[email protected]>
#
# Based on the proposal of : Mark Ruijter
#
version: 1
dn: cn=openssh-lpk,cn=schema,cn=config
changetype: add
cn: openssh-lpk
objectClass: olcSchemaConfig
olcAttributeTypes: ( 1.3.6.1.4.1.24552.500.1.1.1.13 NAME 'sshPublicKey'
DESC 'OpenSSH Public key'
EQUALITY octetStringMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 )
olcObjectClasses: ( 1.3.6.1.4.1.24552.500.1.1.2.0 NAME 'ldapPublicKey' SUP top AUXILIARY
DESC 'OpenSSH LPK objectclass'
MUST uid
MAY sshPublicKey )
dn: cn={5}inetorgperson,cn=schema,cn=config
changetype: modify
replace: olcObjectClasses
olcObjectClasses: ( 2.16.840.1.113730.3.2.2 NAME 'inetOrgPerson' DESC 'RF
C2798: Internet Organizational Person' SUP organizationalPerson STRUCTURAL
MAY ( audio $ businessCategory $ carLicense $ departmentNumber $ displayNam
e $ employeeNumber $ employeeType $ givenName $ homePhone $ homePostalAddre
ss $ initials $ jpegPhoto $ labeledURI $ mail $ manager $ mobile $ o $ page
r $ photo $ roomNumber $ secretary $ uid $ userCertificate $ x500uniqueIden
tifier $ preferredLanguage $ userSMIMECertificate $ userPKCS12 $ sshPublicK
ey ) )
This works great – I'm able to modify users to add their public key details to their record, and then read that data from other clients.
Problems pop up when I try to back up the database using slapcat
though:
5b044b38 olcObjectClasses: value #0 olcObjectClasses: AttributeType not found: "sshPublicKey"
5b044b38 config error processing cn={5}inetorgperson,cn=schema,cn=config: olcObjectClasses: AttributeType not found: "sshPublicKey"
slapcat: bad configuration file!
What have I done wrong that slapcat
isn't able to see the definition for sshPublicKey
?
You shouldn't have modified
inetorgperson
. There was no need to do that. Any number ofAUXILIARY
ObjectClasses can co-exists together (with oneSTRUCTURAL
objectClass).Your slapd may be okay if you restart it.