<?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=89" />

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

<author><name><![CDATA[Yubico Forum]]></name></author>
<id>https://forum.yubico.com/feed.php?f=3&amp;t=89</id>
<entry>
<author><name><![CDATA[youngpro]]></name></author>
<updated>2009-08-11T04:25:46+01:00</updated>
<published>2009-08-11T04:25:46+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=89&amp;p=1657#p1657</id>
<link href="https://forum.yubico.com/viewtopic.php?t=89&amp;p=1657#p1657"/>
<title type="html"><![CDATA[Re: Yubikey and OpenVPN]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=89&amp;p=1657#p1657"><![CDATA[
here is what i have been using...<br /><br />create a file called /etc/openvpn/cserver/yubikeys, or change the yubikeys= path to suite yourself,<br /><br />in it place username:first 12 characters from yubikey token<br />for example,<br />jdoe:fkdjslikdj<br /><br />this sort of pairs back a yubikey to a single user....<br /><br />-----------------------------------<br /><br />#!/bin/sh<br /><br />#DEBUG<br />#username=$1<br />#password=$2<br />gratesuksess=0<br /><br />CLIENT_ID=1<br />log=/var/log/openvpn/clients.log<br />yubikeys=/etc/openvpn/cserver/yubikeys<br /><br />yubimatch=`cat $yubikeys | grep ${username}:`<br />yubimatchuser=`echo $yubimatch | awk -F&quot;:&quot; '{ print $1 }'`<br /><br /><br />if [ &quot;$username&quot; = &quot;$yubimatchuser&quot; ]; then<br />  yubimatchkey=`echo $yubimatch | awk -F&quot;:&quot; '{ print $2 }'`<br />  yubitrimmedkey=`echo $password | sed 's/\(.\{12\}\).*/\1/'`<br /><br /><br />  if [ &quot;$yubimatchkey&quot; = &quot;$yubitrimmedkey&quot; ]; then<br />#    echo DEBUG: $yubimatch - $yubimatchkey<br />    /usr/bin/ykclient ${CLIENT_ID} &quot;${password}&quot;<br />    status=$?<br />    if [ &quot;$status&quot; = &quot;$gratesuksess&quot; ]; then<br />      echo &quot;`date` login success (yubikey match)/ yubikey: $yubitrimmedkey - username: ${username} - token: $password&quot; &gt;&gt;$log<br />      exit $status<br />    else<br />      echo &quot;`date` login failure (yubikey: $status)/ yubikey: $yubitrimmedkey - username: ${username} - token: $password&quot; &gt;&gt;$log<br />      exit 1 <br />    fi     <br />  else<br />    echo &quot;`date` login failure (yubikey mismatch)/ yubikey: $yubitrimmedkey - username: ${username} - token: $password&quot; &gt;&gt;$log  <br />    exit 1<br />  fi<br />else<br />  echo &quot;`date` login failure (username not found)/ yubikey: $yubitrimmedkey - username: ${username} - token: $password&quot; &gt;&gt;$log<br />  exit 1<br />fi<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=784">youngpro</a> — Tue Aug 11, 2009 4:25 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[julian46]]></name></author>
<updated>2008-08-04T17:01:08+01:00</updated>
<published>2008-08-04T17:01:08+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=89&amp;p=519#p519</id>
<link href="https://forum.yubico.com/viewtopic.php?t=89&amp;p=519#p519"/>
<title type="html"><![CDATA[Re: Yubikey and OpenVPN]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=89&amp;p=519#p519"><![CDATA[
thanks for helping on this<br /><br />does anyone have a soln for a windows based (server and client) running OVPN?<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=130">julian46</a> — Mon Aug 04, 2008 5:01 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Simon]]></name></author>
<updated>2008-07-24T11:35:03+01:00</updated>
<published>2008-07-24T11:35:03+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=89&amp;p=473#p473</id>
<link href="https://forum.yubico.com/viewtopic.php?t=89&amp;p=473#p473"/>
<title type="html"><![CDATA[Re: Yubikey and OpenVPN]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=89&amp;p=473#p473"><![CDATA[
<div class="quotetitle">jkbauer24 wrote:</div><div class="quotecontent"><br />I'm using OpenVPN's &quot;auth-user-pass-verify&quot; executable call-out, which forces the OpenVPN client to prompt for a user/password which is verified on the OpenVPN server side.  I use this callout in combination with the &quot;ykclient&quot; that comes with the libyubikey-client-1.1 package.  (You could also use the other clients, as well.)<br /></div><br /><br />Cool!  Thanks for working on this.<br /><br /><div class="quotetitle">jkbauer24 wrote:</div><div class="quotecontent"><br />First, I had to modify the code for ykclient.  As of version 1.1, the last three code lines in ykclient.c look like this:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">ret = yubikey_client_simple_request (token, atoi (client_id), 0, NULL);<br /><br />printf (&quot;Verification output (%d): %s\n&quot;, ret, yubikey_client_strerror (ret));<br /><br />return EXIT_FAILURE;</div><br />I recommend modifying the final line to this:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">return ret;</div><br />...which appears to return a zero (0) value upon success, and non-zero for failure.<br /></div><br /><br />I've done something similar in ykclient version 1.2, could you test it?  Then it should work without any modifications.<br /><br />Thanks,<br />Simon<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=2">Simon</a> — Thu Jul 24, 2008 11:35 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[jkbauer24]]></name></author>
<updated>2008-07-23T03:19:29+01:00</updated>
<published>2008-07-23T03:19:29+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=89&amp;p=459#p459</id>
<link href="https://forum.yubico.com/viewtopic.php?t=89&amp;p=459#p459"/>
<title type="html"><![CDATA[Re: Yubikey and OpenVPN]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=89&amp;p=459#p459"><![CDATA[
I'm using OpenVPN's &quot;auth-user-pass-verify&quot; executable call-out, which forces the OpenVPN client to prompt for a user/password which is verified on the OpenVPN server side.  I use this callout in combination with the &quot;ykclient&quot; that comes with the libyubikey-client-1.1 package.  (You could also use the other clients, as well.)<br /><br />First, I had to modify the code for ykclient.  As of version 1.1, the last three code lines in ykclient.c look like this:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">ret = yubikey_client_simple_request (token, atoi (client_id), 0, NULL);<br /><br />printf (&quot;Verification output (%d): %s\n&quot;, ret, yubikey_client_strerror (ret));<br /><br />return EXIT_FAILURE;</div><br />I recommend modifying the final line to this:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">return ret;</div><br />...which appears to return a zero (0) value upon success, and non-zero for failure.<br /><br />After compiling ykclient and putting it into /usr/local/bin, I wrote the following script called /usr/local/bin/openvpn-yubikey-verify:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">#!/bin/sh<br /><br />CLIENT_ID=###<br /><br />/usr/local/bin/ykclient ${CLIENT_ID} &quot;${password}&quot;<br /><br />exit $?</div><br />(Be sure to replace ### with your Yubico client ID.)<br /><br />Next, I added this line to openvpn.conf on the server:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">auth-user-pass-verify /usr/local/bin/openvpn-yubikey-verify via-env</div><br />And finally, I added this line to openvpn.conf on the client:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">auth-user-pass</div><br />A restart of both the OpenVPN client and server is required.<br /><br />This code will &quot;get you going,&quot; but it's recommended that a more robust script be used to check for proper usernames (the above example ignores the ${username} variable entirely) and bounds-check the password (perhaps using a filter to consider only ModHex characters).<br /><br />Be sure to use proper permissions to secure all of your files.<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=212">jkbauer24</a> — Wed Jul 23, 2008 3:19 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[julian46]]></name></author>
<updated>2008-06-10T12:37:16+01:00</updated>
<published>2008-06-10T12:37:16+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=89&amp;p=227#p227</id>
<link href="https://forum.yubico.com/viewtopic.php?t=89&amp;p=227#p227"/>
<title type="html"><![CDATA[Re: Yubikey and OpenVPN]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=89&amp;p=227#p227"><![CDATA[
someone else mentioned start at the PAM module - so it looks like I have some digging to do <img src="https://forum.yubico.com/images/smilies/icon_e_smile.gif" alt=":)" title="Smile" /><p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=130">julian46</a> — Tue Jun 10, 2008 12:37 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[paul]]></name></author>
<updated>2008-06-10T07:38:34+01:00</updated>
<published>2008-06-10T07:38:34+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=89&amp;p=214#p214</id>
<link href="https://forum.yubico.com/viewtopic.php?t=89&amp;p=214#p214"/>
<title type="html"><![CDATA[Re: Yubikey and OpenVPN]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=89&amp;p=214#p214"><![CDATA[
Sounds a very good idea to me! Do you think Yubico's PAM module is enough for the integration?<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=55">paul</a> — Tue Jun 10, 2008 7:38 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[julian46]]></name></author>
<updated>2008-06-09T22:18:39+01:00</updated>
<published>2008-06-09T22:18:39+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=89&amp;p=209#p209</id>
<link href="https://forum.yubico.com/viewtopic.php?t=89&amp;p=209#p209"/>
<title type="html"><![CDATA[Yubikey and OpenVPN]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=89&amp;p=209#p209"><![CDATA[
has anyone figured this out yet - seems like a great fit<br /><br />thanks<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=130">julian46</a> — Mon Jun 09, 2008 10:18 pm</p><hr />
]]></content>
</entry>
</feed>