Friday, April 13, 2018

Solaris 11.4: LDAP changes for ldapsearch & ldapmodify

With the release of Oracle Solaris 11.4 Beta and the move over to OpenLDAP, you will notice ldap commands have changed. To help myself and may be some others I will document the changes for reference.

Ref: Using ldapsearch to do an LDAP Search using TLS/SSL
       Updated: How to Connect Securely to LDAP using PHP
       How To Manage and Use LDAP Servers with OpenLDAP Utilities


Solaris 11.3
 # ldapsearch -h ldap.dcs.bbk.ac.uk -p 636 -Z -P /var/ldap \  
     -b "dc=dcs,dc=bbk,dc=ac,dc=uk" \  
     -D "CN=auser,OU=Users,DC=dcs,DC=bbk,DC=ac,DC=uk" \  
     -w MyPassword \  
     "samaccountname=auser" uidNumber  
 version: 1  
 dn: CN=auser,OU=Users,DC=dcs,DC=bbk,DC=ac,DC=uk  
 uidNumber: 26575  
Solaris 11.4
 # export LDAPTLS_REQCERT=never  
 # ldapsearch -x -H ldaps://ldap.dcs.bbk.ac.uk:636 \  
      -b "dc=dcs,dc=bbk,dc=ac,dc=uk" \  
      -D "CN=auser,OU=Users,DC=dcs,DC=bbk,DC=ac,DC=uk" \  
      -w MyPassword \  
     "samaccountname=auser" uidNumber  
 # extended LDIF  
 #  
 # LDAPv3  
 # base with scope subtree  
 # filter: samaccountname=auser  
 # requesting: uidNumber  
 #  
 # auser, MSc, StudentUsers, dcs.bbk.ac.uk  
 dn: CN=auser,OU=Users,DC=dcs,DC=bbk,DC=ac,DC=uk  
 uidNumber: 26575  
 # search reference  
 ref: ldaps://dcs.bbk.ac.uk/CN=Configuration,DC=dcs,DC=bbk,DC=ac,DC=uk  
 # search result  
 search: 2  
 result: 0 Success  
 # numResponses: 5  
 # numEntries: 1  
 # numReferences: 3  

Solaris 11.3
 ldapmodify -r -h ldap.dcs.bbk.ac.uk -p 636 -Z -P /var/ldap \  
       -D 'cn=root,ou=users,dc=dcs,dc=bbk,dc=ac,dc=uk' -w MyPassword  
Solaris 11.4
 ldapmodify -x -H ldaps://ldap.dcs.bbk.ac.uk:636 \   
       -D 'cn=root,ou=users,dc=dcs,dc=bbk,dc=ac,dc=uk' -w MyPasssord  

Formatting: I now use http://codeformatter.blogspot.co.uk for code formatting.

No comments: