<div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">HI Simo,</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Thanks for the reply. Could you please elaborate or point me to some documentation on how to set this up. </div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">What I want to be able to achieve is that a user should login with a 2FA once a day and all subsequent logins are allowed thru public key only. </div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Regards.</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">--Prashant</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 30 June 2015 at 15:44, Simo Sorce <span dir="ltr"><<a href="mailto:simo@redhat.com" target="_blank">simo@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, 2015-06-30 at 10:06 +0200, Sumit Bose wrote:<br>
> On Tue, Jun 30, 2015 at 09:31:55AM +0200, Jakub Hrozek wrote:<br>
> > On Tue, Jun 30, 2015 at 09:22:13AM +0200, Sumit Bose wrote:<br>
> > > On Tue, Jun 30, 2015 at 09:09:19AM +0200, Jakub Hrozek wrote:<br>
> > > > On Tue, Jun 30, 2015 at 11:34:55AM +0530, Prashant Bapat wrote:<br>
> > > > > Hi,<br>
> > > > ><br>
> > > > > I was able to set this up in a Fedora instance with SSSD and it works as<br>
> > > > > expected. SSHD first uses the public key and then prompts for password<br>
> > > > > which is ofcourse password+OTP.<br>
> > > > ><br>
> > > > > However, having a user enter the password+OTP every time he logs in during<br>
> > > > > the day is kind of inconvenient. Is it possible to make sure the user has<br>
> > > > > to login once and the credentials are cached for say 12/24 hours. I know<br>
> > > > > this is possible just using the password. Question is, is this possible<br>
> > > > > using password+OTP?<br>
> > > ><br>
> > > > We have an SSSD feature under review now that would help you:<br>
> > > >     <a href="https://fedorahosted.org/sssd/ticket/1807" rel="noreferrer" target="_blank">https://fedorahosted.org/sssd/ticket/1807</a><br>
> > > ><br>
> > > > But to be honest, I'm not sure if we tested the patches with 2FA yet. We<br>
> > > > should!<br>
> > ><br>
> > > hm, I agree we should, but I guess we should test that cached<br>
> > > authentication does _not_ work with 2FA/OTP. Because it is expected that<br>
> > > the OTP token only works once, so that e.g. it can be used in an<br>
> > > insecure environment to set up a secure tunnel.<br>
> ><br>
> > Sure, the second factor must not be reused :-) but couldn't we use the<br>
> > cached auth to support cases like this where the second factor is to be<br>
> > used only once per some time and use only the first factor in the<br>
> > meantime?<br>
><br>
> I'm a bit reluctant here. If the two factors are intercepted in an<br>
> insecure environment the attacker will still have a valid password which<br>
> can be used for some time. Additionally, iirc cached authentication is<br>
> not aware of the service used. If e.g. OTP was used to just get a<br>
> response from some unprotected and unprivileged service the intercepted<br>
> password can be used to log in with ssh as well. So I guess we need a<br>
> careful discussion here.<br>
<br>
</div></div>The solution for this environments already exists and it is called<br>
GSSAPI. You can obtain a ticket with 2FA and then use your TGT for 10 or<br>
more hours. There is no need to invent broken ways to skip two factor<br>
auth when we already have a way to make this easy *and* secure.<br>
<span class="HOEnZb"><font color="#888888"><br>
Simo.<br>
<br>
--<br>
Simo Sorce * Red Hat, Inc * New York<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
--<br>
Manage your subscription for the Freeipa-users mailing list:<br>
<a href="https://www.redhat.com/mailman/listinfo/freeipa-users" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/freeipa-users</a><br>
Go to <a href="http://freeipa.org" rel="noreferrer" target="_blank">http://freeipa.org</a> for more info on the project<br>
</div></div></blockquote></div><br></div>