Bug 13517 - heidmal to mit kerberos migration: passwords expire
Summary: heidmal to mit kerberos migration: passwords expire
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: AD: LDB/DSDB/SAMDB (show other bugs)
Version: 4.7.6
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Andreas Schneider
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-10 09:02 UTC by Alexis Pellicier
Modified: 2019-07-26 08:31 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexis Pellicier 2018-07-10 09:02:07 UTC
After performing migration form heidmal to mit kerberos in samba 4.7.6 can't authenticate:

kinit administrator@SAMBA.DOM
Password for administrator@SAMBA.DOM
Password expired.  You must change it now.

kinit: Password has expired while getting initial credentials

Here is the logs of this action:

Jun 28 09:00:08  krb5kdc[13768](info): AS_REQ (8 etypes {18 17 20 19 16 23 25 26}) 192.168.1.194: CLIENT KEY EXPIRED: administrator@SAMBA.DOM for krbtgt/SAMBA.DOM@SAMBA.DOM, Password has expired

Jun 28 09:00:08  krb5kdc[13768](info): AS_REQ (8 etypes {18 17 20 19 16 23 25 26}) 192.168.1.194: NEEDED_PREAUTH: administrator@SAMBA.DOM for kadmin/changepw@SAMBA.DOM, Additional pre-authentication required

Jun 28 09:00:11  krb5kdc[13768](info): AS_REQ (8 etypes {18 17 20 19 16 23 25 26}) 192.168.1.194: ISSUE: authtime 1530165611, etypes {rep=18 tkt=23 ses=23}, administrator@SAMBA.DOM for kadmin/changepw@SAMBA.DOM

Jun 28 09:00:18  krb5kdc[13768](info): AS_REQ (8 etypes {18 17 20 19 16 23 25 26}) 192.168.1.194: CLIENT KEY EXPIRED: administrator@SAMBA.DOM for krbtgt/SAMBA.DOM@SAMBA.DOM, Password has expired
Comment 1 Andrew Bartlett 2018-07-10 09:36:39 UTC
Andreas,

Can you look into this please?

Andrew Bartlett
Comment 2 Andreas Schneider 2018-08-28 12:36:15 UTC
Can you please provide logs with 'log level 10' set in smb.conf?
Comment 3 Alexis Pellicier 2018-08-29 09:35:19 UTC
(In reply to Andreas Schneider from comment #2)

You 'll find them here:

https://ns358454.ovh.net/mit_kdc-log.samba.log
Comment 4 Andreas Schneider 2018-09-04 17:56:08 UTC
It doesn't show anything interesting, I wonder if there is some on disk cache from Heimdel around which MIT Kerberos picked up.

Did you check the account of the administrator if the password expire flag set in ldap?
Comment 5 Alexis Pellicier 2018-09-05 06:06:32 UTC
(In reply to Andreas Schneider from comment #4)
Hi,

How would you check this password expire flag? 

#ldbsearch -H /var/lib/samba/private/sam.ldb cn=administrator
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: user
cn: Administrator
description: Built-in account for administering the computer/domain
instanceType: 4
whenCreated: 20130405142036.0Z
uSNCreated: 3545
name: Administrator
objectGUID: 28dce644-577c-41e3-93ce-b83bffa17f35
userAccountControl: 512
badPwdCount: 0
codePage: 0
countryCode: 0
badPasswordTime: 0
lastLogoff: 0
objectSid: ..................-500
adminCount: 1
accountExpires: 9223372036854775807
sAMAccountName: Administrator
sAMAccountType: 805306368
objectCategory: CN=Person,CN=Schema,CN=Configuration,
isCriticalSystemObject: TRUE
memberOf: CN=Administrators,CN=Builtin,
memberOf: CN=Group Policy Creator Owners,CN=Users,
memberOf: CN=Enterprise Admins,CN=Users,
memberOf: CN=Schema Admins,CN=Users,
memberOf: CN=Domain Users,CN=Users,
primaryGroupID: 512
lastLogonTimestamp: 131800061181754450
lastLogon: 131800066398855230
logonCount: 127710
pwdLastSet: 131800066490057080
whenChanged: 20180829085729.0Z
uSNChanged: 402540
distinguishedName: CN=Administrator,CN=Users,
Comment 6 Andreas Schneider 2018-09-17 05:56:42 UTC
Looks like this can be reproduced with '--must-change-at-next-login'.
Comment 7 Alexis Pellicier 2018-11-27 07:16:32 UTC
Hello,
I've finally found some times to make some test.
It's with the opensuseLeap 15 packages:
version 4.7.10-git.124.8d97fe90926lp150.3.9.1-SUSE-oS15.0-x86_64

My admin account looks like this:
#pdbedit -u administrator -v:
Account Flags:        [U          ] 
Password must change: never    

After migrated to MIT kerberos administraor won't authenticate till I set explicitly "now expiry"
#pdbedit -u adminsitrator -c [X]
or samba-tool user setexpiry administrator --noexpiry

Then:
#pdbedit -u administrator -v:
Password must change: mar., 19 janv. 2038 06:14:07 +03

and kinit administrator works.

But here's what I get When I create a new user:
#samba-tool user create newuser password

#pdbedit -u newuser -v:
Password last set:    mar., 27 nov. 2018 09:57:50 +03
Password can change:  mar., 27 nov. 2018 09:57:50 +03
Password must change: never

And this new user won't authenticatet till I 
#samba-tool user setexpiry newuser --noexpiry
Comment 8 Isaac Boukris 2019-01-15 17:19:08 UTC
Hi, I noticed this resembles to one of the bugs we solved in bug 13571 related to password expiry, which is already in master, so it may be worth checking.
Comment 9 Andreas Schneider 2019-01-17 08:28:58 UTC
This should be in Samba 4.10.0rc1 which just has been released!
Comment 10 Stefan Metzmacher 2019-07-26 08:31:44 UTC
Most likely be fixed in 4.10.0 and higher