Sometimes the diradmin account or some other admin account’s password becomes corrupted resulting in you unable to log into the Open Directory with admin rights. To reset the password to fix the corruption run the following commands:
sudo mkpassdb -setpassword 0x484f162b4b8b45670000000200000002
where the long hex string is the <slot id> for the diradmin account. You can find <slot id> values for Open Directory user accounts by running the command:
sudo mkpassdb -dump
To summarize, the command to reset an Open Directory user account password is:
sudo mkpassdb -setpassword
specifying your diradmin slot id and you’ll be prompted to reset the diradmin password.