linux_wiki:freeipa_report_ldap_config

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

linux_wiki:freeipa_report_ldap_config [2019/05/25 23:50] (current)
Line 1: Line 1:
 +====== FreeIPA: Report LDAP Config ======
 +
 +**General Information**
 +
 +Output all low level LDAP Config settings. 
 +
 +**Checklist**
 +  * Distro(s):Enterprise Linux 6/7
 +  * Other: [[http://www.unixmen.com/configure-freeipa-server-centos-7/|FreeIPA Server Installed]] (script runs there)
 +
 +----
 +
 +====== The Script ======
 +
 +<code bash report-ldap-config.sh>
 +#!/bin/bash
 +# Name: report-ldap-config.sh
 +# Description: Show all LDAP Configuration Settings
 +# Last Updated: 2016-10-07
 +# Recent Changes:-Added usage and renamed
 +###############################################################################################
 +
 +##### Customize These Variables #####
 +## LDAP Connection Settings ##
 +
 +# Directory Manager User
 +ldapUser='directory manager'
 +
 +# Directory Manager Password
 +dmPass='password-here'
 +
 +# Server Hostname (FQDN)
 +ldapHost='ipaserver.example.com'
 +##### End of Customize Variables #####
 +
 +#=====================================
 +# Functions; Main starts after
 +#=====================================
 +function show_usage
 +{
 +  echo -e "\n==== Report: LDAP Configuration ===="
 +  echo -e "\nDescripton: Report all LDAP Configuration Settings."
 +  echo -e "\n--Usage--"
 +  echo -e "./report-ldap-config.sh [OPTIONS]"
 +  echo -e "\n-OPTIONS-"
 +  echo -e "-h                    => Display usage."
 +  echo -e "\n--Other Requirements--"
 +  echo -e "-> FreeIPA admin access."
 +  echo -e
 +}
 +
 +#=======================
 +# Get Script Arguments
 +#=======================
 +# Reset POSIX variable in case it has been used previously in this shell
 +OPTIND=1
 +
 +while getopts "h" opt; do
 +  case "${opt}" in
 +    h) # -h (help) argument
 +      show_usage
 +      exit 0
 +    ;;
 +    *) # invalid argument
 +      show_usage
 +      exit 0
 +    ;;
 +  esac
 +done
 +
 +#==================
 +# Main Starts Here
 +#==================
 +echo -e "\n>> Dumping LDAP Configuration settings..."
 +ldapsearch -D "cn=${ldapUser}" -w ${dmPass} -p 389 -h ${ldapHost} -x -b cn=config "objectclass=nsslapdConfig"
 +</code>
 +
 +----
  
  • linux_wiki/freeipa_report_ldap_config.txt
  • Last modified: 2019/05/25 23:50
  • (external edit)