LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-14-2015, 11:20 AM   #1
pantdk
Member
 
Registered: Oct 2011
Location: New Delhi
Posts: 248
Blog Entries: 3

Rep: Reputation: 17
ldap users can change their password


Hi All,

Centos6

I am facing issue on my test ldap server server is working fine but i am trying to configure ACL in openldap server so that ldap users can change their password but it show me the below error

ldap_modify: Object class violation (65)
additional info: attribute 'olcTLSCertificateFile' not
allowed


[root@master cn=config]# ldapsearch -LLL -Y EXTERNAL -H ldapi:/// -b cn=config olcSuffix="dc=unxldap,dc=com" dn olcsuffix
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
dn: olcDatabase={2}bdb,cn=config
olcSuffix: dc=unxldap,dc=com



[root@master cn=config]# ldapmodify -Y EXTERNAL -H ldapi:/// -f access-list.ldif
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "olcDatabase={2}bdb,cn=config"
ldap_modify: Object class violation (65)
additional info: attribute 'olcTLSCertificateFile' not
allowed

[root@master cn=config]#


[root@master cn=config]# ll
total 76
-rw-r--r--. 1 root root 287 May 15 03:18 access-list.ldif
drwx------. 2 ldap ldap 4096 May 11 12:01 cn=schema
-rw-------. 1 ldap ldap 51896 May 11 12:01 cn=schema.ldif
-rw-------. 1 ldap ldap 592 May 11 12:01 olcDatabase={0}config.ldif
-rw-------. 1 ldap ldap 525 May 11 12:01 olcDatabase={-1}frontend.ldif
-rw-------. 1 ldap ldap 620 May 11 12:05 olcDatabase={1}monitor.ldif
-rw-------. 1 ldap ldap 1363 May 12 09:38 olcDatabase={2}bdb.ldif
[root@master cn=config]# cat access-list.ldif
dn: olcDatabase={2}bdb,cn=config
changetype: modify
add: olcAccess
olcAccess: to attrs=userPassword
by self write
by anonymous auth
by dn.exact="cn=Manager,ou=Groups,dc=unxldap,dc=com" write
by * none
olcAccess: to *
by dn.base="cn=Manager,dc=unxldap,dc=com" write
by * read
[root@master cn=config]#



[root@master cn=config]# cat olcDatabase\=\{2\}bdb.ldif
dn: olcDatabase={2}bdb
objectClass: olcDatabaseConfig
objectClass: olcBdbConfig
olcDatabase: {2}bdb
olcSuffix: dc=unxldap,dc=com
olcAddContentAcl: FALSE
olcLastMod: TRUE
olcMaxDerefDepth: 15
olcReadOnly: FALSE
olcRootDN: cn=Manager,dc=unxldap,dc=com
olcSyncUseSubentry: FALSE
olcMonitoring: TRUE
olcDbDirectory: /var/lib/ldap
olcDbCacheSize: 1000
olcDbCheckpoint: 1024 15
olcDbNoSync: FALSE
olcDbDirtyRead: FALSE
olcDbIDLcacheSize: 0
olcDbIndex: objectClass pres,eq
olcDbIndex: cn pres,eq,sub
olcDbIndex: uid pres,eq,sub
olcDbIndex: uidNumber pres,eq
olcDbIndex: gidNumber pres,eq
olcDbIndex: mail pres,eq,sub
olcDbIndex: ou pres,eq,sub
olcDbIndex: loginShell pres,eq
olcDbIndex: sn pres,eq,sub
olcDbIndex: givenName pres,eq,sub
olcDbIndex: memberUid pres,eq,sub
olcDbIndex: nisMapName pres,eq,sub
olcDbIndex: nisMapEntry pres,eq,sub
olcDbLinearIndex: FALSE
olcDbMode: 0600
olcDbSearchStack: 16
olcDbShmKey: 0
olcDbCacheFree: 1
olcDbDNcacheSize: 0
structuralObjectClass: olcBdbConfig
entryUUID: 24ad5dfe-8bf3-1034-853c-734d1b37f2f0
creatorsName: cn=config
createTimestamp: 20150511063147Z
entryCSN: 20150511063147.158564Z#000000#000#000000
modifiersName: cn=config
modifyTimestamp: 20150511063147Z
olcRootPW: {SSHA}H4qHRdoNYk7gW8QN7DYiLJtYRwpcadwf
olcTLSCertificateFile: /etc/pki/tls/certs/example.pem
olcTLSCertificateKeyFile: /etc/pki/tls/certs/examplekey.pem

[root@master cn=config]#

Last edited by pantdk; 05-14-2015 at 11:43 AM.
 
Old 05-14-2015, 04:09 PM   #2
pantdk
Member
 
Registered: Oct 2011
Location: New Delhi
Posts: 248

Original Poster
Blog Entries: 3

Rep: Reputation: 17
does i need to change anything to change ??



[root@master cn=config]# ldapsearch -LLLY EXTERNAL -H ldapi:/// -b cn=config -s base |grep -i tls
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
olcTLSCACertificatePath: /etc/openldap/certs
olcTLSCertificateFile: "OpenLDAP Server"
olcTLSCertificateKeyFile: /etc/openldap/certs/password
olcTLSVerifyClient: never
[root@master cn=config]#

[root@master cn=config]# ldapmodify -Y EXTERNAL -H ldapi:/// -f access-list.ldif
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "olcDatabase={2}bdb,cn=config"
ldap_modify: Object class violation (65)
additional info: attribute 'olcTLSCertificateFile' not allowed


[root@master cn=config]# cat olcDatabase\=\{2\}bdb.ldif |grep -i tls
olcTLSCertificateFile: /etc/pki/tls/certs/example.pem
olcTLSCertificateKeyFile: /etc/pki/tls/certs/examplekey.pem
[root@master cn=config]#
 
Old 05-22-2015, 09:05 AM   #3
pantdk
Member
 
Registered: Oct 2011
Location: New Delhi
Posts: 248

Original Poster
Blog Entries: 3

Rep: Reputation: 17
The below changes has been made on the database of LDAP which make it fixed

add these below line at the bottom of the file
# cat olcDatabase\=\{2\}bdb.ldif

olcAccess: to attrs=userPassword by self write by anonymous auth by dn.exact="cn=Manager,ou=Groups,dc=unxldap,dc=com" write by * none
olcAccess: to * by dn.exact="cn=Manager,dc=unxldap,dc=com" write by * read


now login into the client machine & change the password

#passwd

Last edited by pantdk; 05-22-2015 at 09:06 AM.
 
Old 09-08-2017, 03:38 PM   #4
rgistered
Member
 
Registered: Jan 2006
Distribution: arch, CentOS
Posts: 83

Rep: Reputation: 17
I am sorry for bumping into this old thread but I landed here in search for something and I think anybody could land here.

Quote:
The below changes has been made on the database of LDAP which make it fixed

add these below line at the bottom of the file
# cat olcDatabase\=\{2\}bdb.ldif

olcAccess: to attrs=userPassword by self write by anonymous auth by dn.exact="cn=Manager,ou=Groups,dc=unxldap,dc=com" write by * none
olcAccess: to * by dn.exact="cn=Manager,dc=unxldap,dc=com" write by * read


now login into the client machine & change the password

#passwd
This is not the right way for adding attributes to the db. You need to use "ldapmodify" and pass the ldif files with changes (called mods). I was stuck on this very error for the past few hours and the following fixed it for me:

The error you are getting ("additional info: attribute 'olcTLSCertificateFile' not allowed") is because the TLS certificates does not belong to individual databases, they belong to dn: cn=config which is global.

1. Create /tmp/addtls.ldif
Code:
dn: cn=config
changetype: modify
replace: olcTLSCertificateFile
olcTLSCertificateFile: /etc/pki/tls/certs/example.pem
-
replace: olcTLSCertificateKeyFile
olcTLSCertificateKeyFile: /etc/pki/tls/certs/examplekey.pem
Now run the ldapmodify as:
# ldapmodify -H ldapi:// -Y EXTERNAL -f /tmp/addtls.ldif

This should update the location of certificates. Next remove the certificates from individual database (olcDatabase\=\{2\}bdb) in this case:

2. Create /tmp/rmtls.ldif
Code:
dn: olcDatabase={2}hdb,cn=config
changetype: modify
delete: olcTLSCertificateFile
-
delete: olcTLSCertificateKeyFile
Next, run ldapmodify:
# ldapmodify -H ldapi:// -Y EXTERNAL -f /tmp/rmtls.ldif

All that is left is add (in my case) the olcAccess attribute using another ldif file (/tmp/passaccess.ldif)

3. Create /tmp/passaccess.ldif
Code:
dn: olcDatabase={2}hdb,cn=config
changetype: modify
add: olcAccess
olcAccess: to attrs=userPassword by self write by anonymous auth by dn.base="cn=Manager,dc=example,dc=com" write by * none
-
add: olcAccess
olcAccess: to * by self write by dn.base="cn=Manager,dc=example,dc=com" write by * read
Run it as:
# ldapmodify -H ldapi:// -Y EXTERNAL -f /tmp/passaccess.ldif

As we've changed the TLS certs location, a restart for slapd is needed (not everything is automated, yet!)

Hope this helps somebody who is trying to figure out a way out.

PS: Many thanks to @tarpman and @JoBbZ at #openldap for pointing me in the right direction from time to time.
Cheers
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ldap user cannot change their password ainstin Red Hat 1 09-14-2014 10:33 AM
[SOLVED] ldap user not able to change own password Karljoe2 Linux - Server 3 05-03-2012 09:58 PM
Use smbpasswd to change password for ldap users ortodopodo Linux - Server 2 12-30-2009 02:20 AM
Help in LDAP; Users can change their password ashwintumma Linux - Software 1 08-22-2009 10:24 AM
change password at slave ldap u4113072 Linux - Software 0 11-12-2002 02:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration