Bug 55940 - Regression: Server password change doesn't work in AD membermode
Regression: Server password change doesn't work in AD membermode
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Samba
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-3-errata
Assigned To: Arvid Requate
Felix Botner
:
: 56012 56138 (view as bug list)
Depends on: 54390
Blocks:
  Show dependency treegraph
 
Reported: 2023-04-04 09:58 CEST by Felix Botner
Modified: 2023-06-13 05:39 CEST (History)
9 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.429
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2023042121000077
Bug group (optional): bitesize
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Botner univentionstaff 2023-04-04 09:58:21 CEST
+++ This bug was initially created as a clone of Bug #54390 +++

In our automatic tests the server password change in AD membermode doesn't work any more on UCS5 nor UCS4.
We don't know for how long this happens. At least for two months. The test history does not go back that far.

The password change fails trying to set the password on the AD via the "net ads password" command due to a timeout trying to contact the AD.
We can see in the logs:

Password change failed: Cannot contact any KDC for requested realm 

Changing the password works with samba-tool user password -P --newpassword='xxx'
or kpasswd though.
The net tool seems to have become incompatible, if it's due to a change in the tool or AD is unclear. We should change the command to samba-tool.
We should also consider changing the order of commands there. Right now, the whole password change in UCS happens before the password is changed in AD.
In AD membermode it should be the other way around in my opinion because the AD is the leading system. 
The password change should also check if the password change in AD was successful. And only then change the secrets.tdb accordingly.


TL;DR
Setting the server password via "net ads" does not work in AD membermode any more. We should change the command to samba-tool.
Comment 1 Felix Botner univentionstaff 2023-04-04 10:11:08 CEST
We have another problem now. Normal server password change on the server with the ad connector package works.

But we moved the critical "ad member server password" part from univention-samba to univention-ad-connector. 

As we also support additional (samba) servers in the member mode scenario, which only have univention-samba installed, this "ad member server password" part is now missing there and the server password change is incomplete.

e.g. access to smb shares no longer works after the password change

Workaround

-> /usr/bin/samba-tool user password --newpassword=$(password from rrI0YKAHeIPVYg109wHv) -U "$(hostname)\$%$(old password from /etc/machine.secret.old)"
Comment 2 Felix Botner univentionstaff 2023-04-04 10:37:38 CEST
added workaround to scenarios/ad-membermode/autotest-223-admember-w2k12-german-slave.cfg, please remove after bug is fixed
Comment 4 Arvid Requate univentionstaff 2023-04-24 15:09:20 CEST
*** Bug 56012 has been marked as a duplicate of this bug. ***
Comment 5 Arvid Requate univentionstaff 2023-05-02 11:50:26 CEST
git log --grep "Bug #55940":

453c8bc368 | move univention-admember to univention-role-server-common
46b8992762 | Silence univention-admember script non-admember systems
06f3140362 | Remove test workaround
097ad26ee7 | Advisory update
Comment 6 Felix Botner univentionstaff 2023-05-04 08:57:39 CEST
scope: ucs_5.0-0-errata5.0-3
src: univention-ad-connector
fix: 14.0.13-6A~5.0.0.202305021129

scope: ucs_5.0-0-errata5.0-3
src: univention-ad-connector
fix: 15.0.7-3A~5.0.0.202305021145

OK - member mode script moved to univention-server
OK - password changed ad member mode (on slave, without univention-samba)
OK - yaml
Comment 8 Stefan Gohmann univentionstaff 2023-06-13 05:39:36 CEST
*** Bug 56138 has been marked as a duplicate of this bug. ***