How to Change Cyrus' Unknown Password on eMail Server 3.x

Support knowledgebase (rsimai_slems3_cyruspw)
Applies to

eMail Server: Version 3.x

Situation

You have forgotten the administrator's (cyrus) password and thus, you are no longer able to administrate the system. However, you still remember root's password.

Procedure

The password must be changed in /etc/shadow and in /etc/openldap/slapd.conf.
The following script will prove very helpful:
#!/bin/bash
echo "modify the password for cyrus"
echo -e "new password: \c"
read PASS
echo -e
if [ -z "$PASS" ]
then
   echo "sorry, but a blank password is not allowed"
   exit 1
fi
# write new password to /etc/shadow
echo "cyrus:$PASS" | chpasswd

# save created password to slapd.conf 
grep -v "^rootpw" /etc/openldap/slapd.conf >/tmp/slapd.conf.new
NEWPW=`grep "^cyrus" /etc/shadow | cut -f 2 -d ":"`
echo -e "rootpw\t{crypt}$NEWPW" >>/tmp/slapd.conf.new
mv /etc/openldap/slapd.conf /etc/openldap/slapd.conf.oldpw
mv /tmp/slapd.conf.new /etc/openldap/slapd.conf
echo "Password changed! Now restart the LDAP Server to apply" 
echo "the changes with the command 'rcldap restart'"
exit 0
  1. Copy this script to a file, for example cyruspw.sh
  2. Make the file executable
    openexchange:~ # chmod u+x cyruspw.sh
    
  3. Start the script
    openexchange:~ # ./cyruspw.sh
    
  4. Enter cyrus' new password
  5. Restar LDAP
    openexchange:~ # rcldap restart
    

Keywords: IMAP31, SLEMS, EMAILSERVER, CYRUS, PASSWORD, CHANGE

Categories: SuSE Linux IMAP Server

SDB-rsimai_slems3_cyruspw, Copyright SuSE Linux AG, Nürnberg, Germany - Version: 09. Apr 2003
SuSE Linux AG - Last generated: 09. Apr 2003 by ip (sdb_gen 1.40.0)