<div dir="ltr"><span style="font-size:12.8px">Hi Brian</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Thank You for your answer. </div><div style="font-size:12.8px">It started working, not sure yet why it did not work. I need to do some extensive testing.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">So, I've actually followed the blogposts you've mentioned to setup ipanthash + freeradius.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Maybe I'll paraphrase the question.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">It would suffice if I could tell IPA to use pass+otp only instead of both (Password+ pass+otp) for particular hosts.</div><div style="font-size:12.8px">So for example users from hosts X can login with OTP only.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Thanks for help!</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 3, 2017 at 7:02 PM, 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"><span class="">On 03/01/2017 15:28, Maciej Drobniuch wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
We have a topo with 3x IPA servers + freeradius.<br>
<br>
Freeradius is being used to do mschap with wifi APs. Freeradius connects over ldap to IPA.<br>
<br>
In order to do the challange-response thing, freeipa has AllowNTHash enabled.<br>
<br>
So I wanted to enable 2FA/OTP but leave the NTHash as is for wifi auth.<br>
<br>
In the moment I disallow Password auth for a user and enable OTP the wifi auth stopps working, but the hash clearly stays in ldap.<br>
</blockquote></span>
How are you actually authenticating the user? Are you just reading the ipaNTHash out of the LDAP database and letting FreeRADIUS check it? Then AFAICS it shouldn't make any different whether OTP is enabled or not. Can you show more of your RADIUS config, and the debug output from the part which authenticates the user?<br>
<br>
I don't use OTP myself, but I wouldn't expect the ipaNTHash to change depending on whether OTP is enabled or not (and you're saying the hash stays put).<br>
<br>
I have what sounds like a similar setup to yours, using FreeRADIUS 3.0.12 talking to FreeIPA 4.4.0, using a service user which has permissions to read out the ipaNTHash directly, based on this blog post:<br>
<a href="http://firstyear.id.au/blog/html/2015/07/06/FreeIPA:_Giving_permissions_to_service_accounts..html" rel="noreferrer" target="_blank">http://firstyear.id.au/blog/ht<wbr>ml/2015/07/06/FreeIPA:_Giving_<wbr>permissions_to_service_account<wbr>s..html</a><br>
<br>
ldap config:<br>
<br>
base_dn = 'cn=users,cn=accounts,dc=ipa,d<wbr>c=example,dc=com'<br>
<br>
sasl {<br>
mech = 'GSSAPI'<br>
realm = '<a href="http://IPA.EXAMPLE.COM" rel="noreferrer" target="_blank">IPA.EXAMPLE.COM</a>'<br>
}<br>
<br>
update {<br>
control:NT-Password := 'ipaNTHash'<br>
control:Tmp-String-9 := 'krbPasswordExpiration'<br>
}<br>
<br>
user {<br>
base_dn = "${..base_dn}"<br>
filter = "(uid=%{%{Stripped-User-Name}:<wbr>-%{User-Name}})"<br>
scope = "one"<br>
}<br>
<br>
group {<br>
membership_attribute = 'memberOf'<br>
name_attributes = 'cn'<br>
<br>
cacheable_dn = 'yes'<br>
cacheable_name = 'no'<br>
}<br>
<br>
default and inner-tunnel authentication is then just:<br>
<br>
authenticate {<br>
Auth-Type PAP {<br>
pap<br>
}<br>
<br>
Auth-Type MS-CHAP {<br>
mschap<br>
}<br>
<br>
eap<br>
}<br>
<br>
Also you need to put the service user's keytab somewhere, and set a couple of environment variables when it starts, if you want to use Kerberos to protect the LDAP connection. Using systemd override:<br>
<br>
[Unit]<br>
Requires=dirsrv.target<br>
After=dirsrv.target<br>
<br>
[Service]<br>
Environment=KRB5_CLIENT_KTNAME<wbr>=/etc/radiusd.keytab<br>
Environment=KRB5CCNAME=MEMORY:<br>
Restart=always<br>
RestartSec=5<br>
<br>
(Otherwise you can bind with a specific dn and password, but then you also need to sort out TLS to secure the LDAP traffic)<br>
<br>
There is more magic you can do with the krbPasswordExpiration attribute to force the user to do a password change over MSCHAP - but that's now straying a long way from what's relevant on a FreeIPA mailing list.<br>
<br>
HTH,<br>
<br>
Brian.<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Best regards</div><div dir="ltr"><br><div><span style="font-size:12.8px">Maciej Drobniuch</span></div><div>Network Security Engineer</div><div><div style="font-size:small"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div style="font-size:12.8px">Collective-Sense,LLC</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div>