<div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Hi,</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">I was able to set this up in a Fedora instance with SSSD and it works as expected. SSHD first uses the public key and then prompts for password which is ofcourse password+OTP. </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">However, having a user enter the password+OTP every time he logs in during the day is kind of inconvenient. Is it possible to make sure the user has to login once and the credentials are cached for say 12/24 hours. I know this is possible just using the password. Question is, is this possible using password+OTP?</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.</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 27 June 2015 at 13:06, Prashant Bapat <span dir="ltr"><<a href="mailto:prashant@apigee.com" target="_blank">prashant@apigee.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Aah ok !</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">Unfortunately I'm using Amazon Linux and it does not support SSSD. I ended up using nss-pam-ldap, nscd and nslcd. </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">However this looks promising. Only for the servers exposed to Internet I could use CentOS/Fedora and this method of authentication. Let me try this and come back to you. </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.</div><span class="HOEnZb"><font color="#888888"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">--Prashant</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 27 June 2015 at 10:17, Alexander Bokovoy <span dir="ltr"><<a href="mailto:abokovoy@redhat.com" target="_blank">abokovoy@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><div><br>
<br>
----- Original Message -----<br>
> Hi ,<br>
><br>
> I'm exploring implementing a 2FA solution to my servers exposed to public.<br>
> Mainly to secure SSH with 2FA. The SSH keys and users are already in<br>
> FreeIPA.<br>
><br>
> Is there a way to utilize the OTP inside FreeIPA during a user login to these<br>
> servers ? A user will have to enter the TOTP code bases on whats configured<br>
> in FreeIPA. Something along the lines of<br>
> <a href="https://github.com/google/google-authenticator/tree/master/libpam" rel="noreferrer" target="_blank">https://github.com/google/google-authenticator/tree/master/libpam</a><br>
</div></div>If you are using SSSD (pam_sss), it will automatically accept 2FA.<br>
<br>
You need to force OpenSSH to combine authentication methods, something like:<br>
<br>
AuthenticationMethods publickey,password:pam publickey,keyboard-interactive:pam<br>
<br>
Look into sshd_config manual page for details. This is feature of OpenSSH 6.2 or later.<br>
<span><font color="#888888"><br>
--<br>
/ Alexander Bokovoy<br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>