I'm trying to document and give step by step details about setting up an LDAP server I'm responsible for (RHEL 6). I'm having a problem with the olcRootPW line. In my script, I was using:
Code:
cd /etc/openldap/slapd.d/cn=config
FIL4=olcDatabase={2}bdb.ldif
echo "olcRootPW: $(slappasswd -s 'PassW0rd\!23')" >> ${FIL4}
This doesn't put PassW0rd!23 (SSHA encrypted) into the config file. If I run slappasswd at the command line and then copy the result into the config file via vi, it works. If I don't put a '\' in front of the exclamation mark, I get: -bash: !23: event not found
Anyone have a suggestion on how I can script the addition of the password to the configuration file?
Thanks!