samba-tool user setpassword 'pdc$' --newpassword=$(< /etc/machine.secret)
then the msDS-KeyVersionNumber in /var/lib/samba/private/secrets.ldb and
/var/lib/samba/private/sam.ldb differ. Setting the msDS-KeyVersionNumber
to the higher number from sam.ldb in secrets.ldb does NOT help:
root@pdc:~# univention-s4search
Wrong username or password: kinit for pdc$@xxxxxxx.xxx.DE failed (Preauthentication failed)
Failed to bind - LDAP error 49 LDAP_INVALID_CREDENTIALS - <8009030C: LdapErr: DSID-0C0904DC, comment: AcceptSecurityCon|
text error, data 52e, v1db1> <> |
Failed to connect to 'ldaps://pdc.intern.izt.de' with backend 'ldaps': LDAP error 49 LDAP_INVALID_CREDENTIALS - <800903
0C: LdapErr: DSID-0C0904DC, comment: AcceptSecurityContext error, data 52e, v1db1> <>
Failed to connect to ldaps://pdc.xxxxxxx.xxx.de - LDAP error 49 LDAP_INVALID_CREDENTIALS - <8009030C: LdapErr: DSID-0C09
04DC, comment: AcceptSecurityContext error, data 52e, v1db1> <>
have you tried the server-password-change on the server?
If this is not working anymore, because the /etc/machine.secret is no longer valid on the master, you may also set the secret for the server account. You can use the Solution from this article, but only just in case, the server-password-change fails!
problem is, server-password-change does not work: When the scripts in pdc:/usr/lib/univention-server/server_password_change.d/ are run, the change of password for samba breaks and in consequence the whole procedure is rolled back.
If we instead try to change the password manually the problem is the same: Samba does not accept the password. And we do not know why.
Wild guess: Might it be the case that the password is checked against the samba password policy and this fails?
if you have set the complexity for the machine.secret, there could be some characters in the credentials file, that samba do not like.
ucr info machine/password/complexity
machine/password/complexity: <empty>
The machine passwords are generated with the tool pwgen. This variable configures the parameters used during generation (see 'man pwgen'). If the variable is unset, 'scn' applies.
But this would be no problem for the second password change.
So maybe you can provide the logfile from the server-password-change, there might be some hints there.
Doing a manual server-password change is a little bit tricky, because you have to set, after you changed the password via samb-tool, the new secret manual. Because samba does not read /etc/machine.secret automatically, it uses a separate file for this, which you can edit via ldbedit / ldbmodify (not ldapmodify !):
If you change the password manually, then the msDS-KeyVersionNumber must be adjusted here directly so that it matches the value in sam.ldb. Samba automatically increments the value in sam.ldb by one counter each time the password hash is changed. If you change the password in secrets.ldb you have to increase the msDS-KeyVersionNumber stored there directly in the same step.