LinuxQuestions.org
Help answer threads with 0 replies.
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 12-12-2012, 08:11 AM   #1
bradvan
Member
 
Registered: Mar 2009
Posts: 367

Rep: Reputation: 61
slappasswd help


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!
 
Old 12-12-2012, 08:37 AM   #2
bradvan
Member
 
Registered: Mar 2009
Posts: 367

Original Poster
Rep: Reputation: 61
OK, I figured out a work around. If anyone has a suggestion on how to accomplish in one line, I'd appreciate hearing it.

Code:
FIL6=/tmp/ldap_pass.$$
slappasswd -s 'PassW0rd!23' > ${FIL6}
echo "olcRootPW: $(cat ${FIL6})" >> ${FIL4}
/bin/rm ${FIL6}
Thanks!
 
  


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
[SOLVED] Slappasswd command output redirection karapet Linux - Server 1 10-20-2012 10:54 AM

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

All times are GMT -5. The time now is 07:14 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