<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
<link rel="self" type="application/atom+xml" href="https://forum.yubico.com/feed.php?f=3&amp;t=351" />

<title>Yubico Forum</title>
<subtitle>...visit our web-store at</subtitle>
<link href="https://forum.yubico.com/index.php" />
<updated>2009-08-31T15:07:08+01:00</updated>

<author><name><![CDATA[Yubico Forum]]></name></author>
<id>https://forum.yubico.com/feed.php?f=3&amp;t=351</id>
<entry>
<author><name><![CDATA[msvilp]]></name></author>
<updated>2009-08-31T15:07:08+01:00</updated>
<published>2009-08-31T15:07:08+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=351&amp;p=1729#p1729</id>
<link href="https://forum.yubico.com/viewtopic.php?t=351&amp;p=1729#p1729"/>
<title type="html"><![CDATA[Re: using pam module for SSH auth without requiring passwd]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=351&amp;p=1729#p1729"><![CDATA[
Hello again,<br /><br />I have now tested different configurations, and it is actually quite easy to require password+YubiKey for some users and just passwd for others. All this is accomplished with <em>pam_succeed_if.so</em> module along with some specific control values for PAM.<br /><br />First, create group <em>yubikey-passwd-auth</em>. Also, have the YubiKey mapping file ready (mine is in <em>etc/security/yubikey.map</em>). Beware, if the user has no YubiKey mapping, and YubiKey-login is enforced, the user has no way to log in!<br /><br />I created a file <em>/etc/pam.d/yubikey-passwd-auth</em>:<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent"># PAM configuration file for password+YubiKey authentication, if the user <br /># is in group yubikey-passwd-auth<br /><br /># Skip the following rules if user is not in the specified group<br />auth    &#91;success=2 default=ignore&#93; pam_succeed_if.so    quiet  user notingroup yubikey-passwd-auth<br /><br /># Perform YubiKey authentication and die if this fails<br />auth  requisite      pam_yubico.so    id=XX authfile=/etc/security/yubikey.map<br /><br /># Check the password returned from the pam_yubico module, declare authentication done <br /># if this succeeds, die if it fails<br />auth  &#91;success=done default=die&#93;  pam_unix.so    use_first_pass<br /></div><br /><br />And, the following code must be added to a sevice file in <em>/etc/pam.d/</em>:<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">@include yubikey-passwd-auth<br /></div><br /><br />This code must be added just before the pam_unix.so call, or before the <em>@include common-auth</em> line (or similar).<br /><br />You can go even further and configure your system so that:<br /><ul><li> Users in <em>yubikey-passwd-auth</em> authenticate with passwd+Yubikey</li><li> Users in <em>yubikey-auth</em> can authenticate with Yubikey, without password</li><li> Other users use only password</li></ul><br />For this, the <em>yubikey-auth</em> file would look like this:<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent"># PAM configuration file for YubiKey authentication, if the user is in group yubikey-auth<br /><br /># Skip the following rule if user is not in the specified group<br />auth    &#91;success=1 default=ignore&#93; pam_succeed_if.so    quiet  user notingroup yubikey-auth<br /><br /># Perform YubiKey authentication<br />auth  &#91;success=done default=die&#93;   pam_yubico.so    id=XX authfile=/etc/security/yubikey.map<br /></div><br /><br />How does this method look like? Are there any security considerations? Configuring two-factor authentication with PAM seems very elegant solution to me, as Yubico PAM module can be stacked with any other authentication module. There is also no need to modify the Yubico PAM module to support complex configurations.<br /><br /><br />- Mikko<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=591">msvilp</a> — Mon Aug 31, 2009 3:07 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[msvilp]]></name></author>
<updated>2009-08-26T07:25:56+01:00</updated>
<published>2009-08-26T07:25:56+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=351&amp;p=1703#p1703</id>
<link href="https://forum.yubico.com/viewtopic.php?t=351&amp;p=1703#p1703"/>
<title type="html"><![CDATA[Re: using pam module for SSH auth without requiring passwd]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=351&amp;p=1703#p1703"><![CDATA[
It is possible to configure PAM so that users can log in with YubiKey or password. Those users who don't have a YubiKey (specified in mapping file), can log in only with password.<br /><br />I have done this with following auth-rules:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">auth  sufficient pam_yubico.so (arguments...)<br />auth  required  pam_unix.so (arguments...)<br /></div><br /><br />If <em>sufficient</em>-control returns OK, no further auth-rules are checked, so make sure that there are no more auth-lines after these.<br /><br />PAM seems to be quite versatile, and different kind of modules can be stacked together to achieve desired behaviour. There is, for example, <a href="http://www.spellweaver.org/devel/" class="postlink">pam_lockout</a> -module, that returns <em>fail</em> for specified user or group. More complex alternative could be pam_listfile, which is included in most distributions already. Using the substack-control in PAM configuration, it might be possible to do the following (or just about anything similar):<br /><br /><ul><li>by default, users can authenticate with a password</li><li>users in group <em>yubikey_auth_only</em> must use a YubiKey (or password+YubiKey)</li></ul><br />I will do some tests with these kind of configurations. If you are intrested, check the PAM documantation in <a href="http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/Linux-PAM_SAG.html" class="postlink">http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/Linux-PAM_SAG.html</a>, and tell if you come up with a working solution.<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=591">msvilp</a> — Wed Aug 26, 2009 7:25 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[network-marvels]]></name></author>
<updated>2009-07-09T08:55:46+01:00</updated>
<published>2009-07-09T08:55:46+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=351&amp;p=1564#p1564</id>
<link href="https://forum.yubico.com/viewtopic.php?t=351&amp;p=1564#p1564"/>
<title type="html"><![CDATA[Re: using pam module for SSH auth without requiring passwd]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=351&amp;p=1564#p1564"><![CDATA[
The current Yubico PAM module is designed to support two factor authentication. Using the current PAM module it will not be possible to provide just YubiKey based one factor authentication (Username + YubiKey OTP) for some users and password based authentication for other users (Username + Password). However, using the current PAM module some users can be provided with YubiKey based two factor authentication (Username + Password + YubiKey OTP) and other users with password based authentication (Username + Password). Providing such a functionality would require some modifications in the current Yubico PAM module.<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=280">network-marvels</a> — Thu Jul 09, 2009 8:55 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[pl4yer0ne]]></name></author>
<updated>2009-07-08T08:53:58+01:00</updated>
<published>2009-07-08T08:53:58+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=351&amp;p=1557#p1557</id>
<link href="https://forum.yubico.com/viewtopic.php?t=351&amp;p=1557#p1557"/>
<title type="html"><![CDATA[using pam module for SSH auth without requiring passwd]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=351&amp;p=1557#p1557"><![CDATA[
Hi all,<br /><br />So the pam module works really well, got the authorised keys stuff all working as well.<br /><br />What I am trying to do though is allow ssh access via yubikey without a password OR via password without the yubikey.  Is there any way to get that happening?  I was thinking of having an option to either require 2 factor or not possibly per user/per module.<br /><br />The idea is to allow some users to login via shh or use sudo and similar via a yubikey while allowing other users to use passwords and PKI as normal.<br /><br />Any help appreciated.<br /><br />P1<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=704">pl4yer0ne</a> — Wed Jul 08, 2009 8:53 am</p><hr />
]]></content>
</entry>
</feed>