saslpasswd2 programmatically password

Howard Chu hyc at
Mon Oct 21 13:51:47 EDT 2013

Dan White wrote:
> On 10/20/13 14:27 +0200, Pol Hallen wrote:
>> Howdy :-)
>> I need create a script to set programmatically password to sasldb users
>> #!/bin/bash
>> pass=test
>> saslpasswd -c -u user0
>> how pass variable $pass to this script?
> /bin/echo "$password" | /usr/sbin/saslpasswd2 -a $service_name $username
> This is inappropriate for a multi-user system since the password will show
> up in a process list.
You can avoid that by *not* using /bin/echo. If you leave it unqualified 
you'll get the shell builtin command, and nothing will show up in the process 

   -- Howard Chu
   CTO, Symas Corp. 
   Director, Highland Sun
   Chief Architect, OpenLDAP

More information about the Cyrus-devel mailing list