<div dir="ltr">David & Brian,<div>I'm familiar with the usual password expiration message that shows up which forces you to change the password. I've seen that before. However, I didn't see it this time, which is odd. Since I was able to kinit, I reset the password, and it started working again. I don't have an account in this failed state currently, but is it possible to force password expiration in order to reproduce this again ? Something like "<span style="color:rgb(0,0,0)">ipa user-mod myuser --setattr=krbpasswordexpiration=</span>" should work, right ?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 25, 2016 at 3:54 AM, Brian Candler <span dir="ltr"><<a href="mailto:b.candler@pobox.com" target="_blank">b.candler@pobox.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><span class="">
<div class="m_1285858460913169024moz-cite-prefix">On 25/10/2016 00:02, Prasun Gera wrote:<br>
</div>
<blockquote type="cite">I've seen some different behaviour. I've had errors
for users (including the admin user) trying to log in with
possibly an expired password. Both webui and ssh would fail, but
kinit would work. I'm not sure if this is related to the
password's expiration or the account's expiration. My
/var/log/secure has messages like "pam_sss(sshd:auth): received
for user uname: 13 (User account has expired)". Is there a setting
for default expiration of user accounts ? I don't remember setting
it anywhere. <br>
</blockquote>
</span><p>By "account expiration" do you mean the "--principal-expiration"
option to ipa user-xxx? Or is there another setting?<br>
</p>
Code 13 is PAM_ACCT_EXPIRED, at least in the "new" constants<br>
<br>
$ egrep '\b13\b' /usr/include/security/*pam*<br>
/usr/include/security/_pam_<wbr>compat.h:# define PAM_USER_UNKNOWN
13<br>
/usr/include/security/_pam_<wbr>types.h:#define PAM_ACCT_EXPIRED 13 /*
User account has expired */<br>
/usr/include/security/_pam_<wbr>types.h:#define PAM_AUTHTOK_TYPE 13
/* The type for pam_get_authtok */<br>
<p>This to me implies it's not looking at the <span>krbPasswordExpiration</span>
attribute, because it could (or should) use PAM_AUTHTOK_EXPIRED
(27) for that instead.<br>
</p>
<p>For me, pam_sss seems to handle expiry correctly. For example if
I reset an account password (which in turn causes it to expire
immediately), and then someone logs in their ssh private key, and
subsequently does "sudo", sudo prompts them for the password,
tells them it has expired, but gives them the opportunity to
change it.</p>
<p>However it's not impossible that the PAM module has some buried
logic, e.g. it refuses to use a password which expired more than X
days ago. That was the reason for my original question. I guess I
should try setting some expiry date way in the past.<br>
</p>
<p>The other thing is to look in the source code for pam_sss to see
under which conditions it returns PAM_ACCT_EXPIRED. The answer
is: when it gets ERR_ACCOUNT_EXPIRED from
parse_krb5_child_response. Which in turn is when we get
KRB5KDC_ERR_NAME_EXP from Kerberos. Which in turn is "Client's
entry in database has expired".<br>
</p>
<p><a class="m_1285858460913169024moz-txt-link-freetext" href="http://web.mit.edu/kerberos/krb5-1.5/krb5-1.5.4/doc/krb5-admin/Kerberos-V5-Library-Error-Codes.html" target="_blank">http://web.mit.edu/kerberos/<wbr>krb5-1.5/krb5-1.5.4/doc/krb5-<wbr>admin/Kerberos-V5-Library-<wbr>Error-Codes.html</a><br>
</p>
<p>But as has already been said - if the *principal* has expired you
shouldn't be able to login with kinit at all.<br>
</p>
<p>Regards,</p>
<p>Brian.<br>
</p>
</div>
</blockquote></div><br></div>