<?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=8&amp;t=246" />

<title>Yubico Forum</title>
<subtitle>...visit our web-store at</subtitle>
<link href="https://forum.yubico.com/index.php" />
<updated>2013-08-08T09:45:02+01:00</updated>

<author><name><![CDATA[Yubico Forum]]></name></author>
<id>https://forum.yubico.com/feed.php?f=8&amp;t=246</id>
<entry>
<author><name><![CDATA[Tom]]></name></author>
<updated>2013-08-08T09:45:02+01:00</updated>
<published>2013-08-08T09:45:02+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=246&amp;p=4223#p4223</id>
<link href="https://forum.yubico.com/viewtopic.php?t=246&amp;p=4223#p4223"/>
<title type="html"><![CDATA[Re: [linux] Lock\Unlock system with Yubikey removal\insertio]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=246&amp;p=4223#p4223"><![CDATA[
Hello,<br /><br />It would be great is someone could create a neat HOW-TO for this following the guidelines <!-- l --><a class="postlink-local" href="http://forum.yubico.com/viewtopic.php?f=16&amp;t=918">viewtopic.php?f=16&amp;t=918</a><!-- l --> here...<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=2195">Tom</a> — Thu Aug 08, 2013 9:45 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[SphaZ]]></name></author>
<updated>2013-08-08T09:03:06+01:00</updated>
<published>2013-08-08T09:03:06+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=246&amp;p=4222#p4222</id>
<link href="https://forum.yubico.com/viewtopic.php?t=246&amp;p=4222#p4222"/>
<title type="html"><![CDATA[Re: [linux] Lock\Unlock system with Yubikey removal\insertio]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=246&amp;p=4222#p4222"><![CDATA[
Works pretty well in Kali (Debian based)<br /><br />However if you use your Yubikey in HMAC-SHA1 challenge-response mode; this will also enable your screensaver when you do &quot;sudo&quot; in a terminal. And I have yet to figure out how to allow unlocking of gnome-screensaver in challenge-response mode  <img src="https://forum.yubico.com/images/smilies/icon_neutral.gif" alt=":|" title="Neutral" /><p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=2510">SphaZ</a> — Thu Aug 08, 2013 9:03 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[cafuego]]></name></author>
<updated>2012-06-04T03:24:34+01:00</updated>
<published>2012-06-04T03:24:34+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=246&amp;p=3125#p3125</id>
<link href="https://forum.yubico.com/viewtopic.php?t=246&amp;p=3125#p3125"/>
<title type="html"><![CDATA[Re: [linux] Lock\Unlock system with Yubikey removal\insertio]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=246&amp;p=3125#p3125"><![CDATA[
I'm using 64bit Mint 12 and I've gotten it to work by using the suggested changes to the udev rules:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">ENV{ID_VENDOR_ID}==&quot;1050&quot;, ENV{ID_MODEL_ID}==&quot;0010&quot;</div><br /><br />and by changing the command to stop the screensaver, as the --poke option no longer exists. You should now use:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">su $user -c &quot;/usr/bin/gnome-screensaver-command --deactivate&quot;</div><br /><br />I suspect that these same changes apply to pretty much all distros that use Gnome 3.<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=1348">cafuego</a> — Mon Jun 04, 2012 3:24 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[PH-MJS]]></name></author>
<updated>2011-12-12T20:03:45+01:00</updated>
<published>2011-12-12T20:03:45+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=246&amp;p=2860#p2860</id>
<link href="https://forum.yubico.com/viewtopic.php?t=246&amp;p=2860#p2860"/>
<title type="html"><![CDATA[Re: [linux] Lock\Unlock system with Yubikey removal\insertio]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=246&amp;p=2860#p2860"><![CDATA[
Hi all,<br /><br />I love this feature so much but I've some troubles with it. Maybe you can help me.<br />It seems that it only works when I've opened a Terminal window. it doesn't matter if this window is active or not.<br /><br />When I look in the syslog it shows even if it does not works:<br />Dec 12 19:55:41 PC logger: YubiKey Removed - Locking Workstation<br />Dec 12 19:55:45 PC logger: YubiKey Inserted - Unlocking Workstation<br /><br />I'm running Linux Mint 12 64Bit and Finger installed.<br /><br />Many thanks in advance,<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=1889">PH-MJS</a> — Mon Dec 12, 2011 8:03 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[fvieira]]></name></author>
<updated>2011-11-12T21:06:03+01:00</updated>
<published>2011-11-12T21:06:03+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=246&amp;p=2838#p2838</id>
<link href="https://forum.yubico.com/viewtopic.php?t=246&amp;p=2838#p2838"/>
<title type="html"><![CDATA[Re: [linux] Lock\Unlock system with Yubikey removal\insertio]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=246&amp;p=2838#p2838"><![CDATA[
If the gnome-screensaver-lock and gnome-screensaver-unlock scripts fail to work for some of you, make sure you have <em>finger</em> installed, or else replace <em>finger</em> with <em>who</em> in the scripts.<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=1867">fvieira</a> — Sat Nov 12, 2011 9:06 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[webarnes]]></name></author>
<updated>2011-09-25T08:05:39+01:00</updated>
<published>2011-09-25T08:05:39+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=246&amp;p=2811#p2811</id>
<link href="https://forum.yubico.com/viewtopic.php?t=246&amp;p=2811#p2811"/>
<title type="html"><![CDATA[Re: [linux] Lock\Unlock system with Yubikey removal\insertio]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=246&amp;p=2811#p2811"><![CDATA[
A related script to disable/enable the screen lock in Gnome. It won't unlock the computer if it is locked, but as long as your Yubikey is plugged in, you computer won't lock. The lock is tied to my presence in the apartment, but someone couldn't steal my keys and gain access to my computer.<br /><br />Use the udev method above to run the script.<br /><br /><em>/usr/local/bin/gnome-lock-disable</em> (on udev &quot;add&quot;)<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">#!/bin/bash<br /><br />user=`ps aux | grep gnome-screensaver | head -n 1 | awk '{print $1}'`<br /><br />if &#91; -n $user &#93;; then<br />        GNOME_SCREENSAVER_PROC=`ps xa | grep gnome-screensaver | head -n 1 | awk '{print $1}'`<br />        export `grep -z DBUS_SESSION_BUS_ADDRESS /proc/$GNOME_SCREENSAVER_PROC/environ`<br />        su $user -c &quot;gconftool-2 --set &quot;/apps/gnome-screensaver/lock_enabled&quot; --type bool 0&quot;<br />fi<br /></div><br /><br /><em>/usr/local/bin/gnome-lock-enable</em> (on udev &quot;remove&quot;)<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">#!/bin/bash<br /><br />user=`ps aux | grep gnome-screensaver | head -n 1 | awk '{print $1}'`<br /><br />if &#91; -n $user &#93;; then<br />        GNOME_SCREENSAVER_PROC=`ps xa | grep gnome-screensaver | head -n 1 | awk '{print $1}'`<br />        export `grep -z DBUS_SESSION_BUS_ADDRESS /proc/$GNOME_SCREENSAVER_PROC/environ`<br />        su $user -c &quot;gconftool-2 --set &quot;/apps/gnome-screensaver/lock_enabled&quot; --type bool 1&quot;<br />fi<br /></div><br /><br />I like this DBUS_SESSION_BUS_ADDRESS code the best of all the ones I've seen. I got it from <!-- m --><a class="postlink" href="http://john.nachtimwald.com/2010/07/25/yubikey-auto-lock-in-gnome/">http://john.nachtimwald.com/2010/07/25/ ... -in-gnome/</a><!-- m --><p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=1336">webarnes</a> — Sun Sep 25, 2011 8:05 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[zardoz]]></name></author>
<updated>2011-07-14T22:08:52+01:00</updated>
<published>2011-07-14T22:08:52+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=246&amp;p=2751#p2751</id>
<link href="https://forum.yubico.com/viewtopic.php?t=246&amp;p=2751#p2751"/>
<title type="html"><![CDATA[Re: [linux] Lock\Unlock system with Yubikey removal\insertio]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=246&amp;p=2751#p2751"><![CDATA[
At risk of bumping an old topic, I think the following is worth noting.<br /><br />If you run the automatic lock/unlock functionality, don't try and use the Yubikey personalisation tool.<br />When it scans the yubikey for its firmware rev etc, it will effectively disconnect it and lock the screen.<br /><br />Z.<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=1733">zardoz</a> — Thu Jul 14, 2011 10:08 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[akkornel]]></name></author>
<updated>2010-04-27T00:55:06+01:00</updated>
<published>2010-04-27T00:55:06+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=246&amp;p=2169#p2169</id>
<link href="https://forum.yubico.com/viewtopic.php?t=246&amp;p=2169#p2169"/>
<title type="html"><![CDATA[Re: [linux] Lock\Unlock system with Yubikey removal\insertion]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=246&amp;p=2169#p2169"><![CDATA[
Hello!<br /><br />I am running Ubuntu Hardy (8.04 LTS), and I had to make some changes to get it to work:<br /><br /><ul><li>Move udev rules file<br /><br />I renamed the file from <em>45-yubikey.rules</em> to <em>85-yubikey.rules</em>.<br /><br />I did this rename according to the instructions I found at /etc/udev/rules.d/README:<br /><br /><div class="quotetitle"><b>Quote:</b></div><div class="quotecontent"><br /><em>&lt;&lt;&lt;snip&gt;&gt;&gt;</em><br /><br />Files should be named xx-descriptive-name.rules, the xx should be<br />chosen first according to the following sequence points:<br /><br /><em>&lt;&lt;&lt;snip&gt;&gt;&gt;</em><br /><br />  40   rules that set the permissions of device nodes<br />       (can be overriden by later rules)<br /><br /><em>&lt;&lt;&lt;snip&gt;&gt;&gt;</em><br /><br />  80   rules that run programs (but do not load modules)<br /><br /><em>&lt;&lt;&lt;snip&gt;&gt;&gt;</em><br /><br />Packages should chose the approriate sequence point and add 5 to it<br />(e.g. 25-iftab.rules, 45-libsane.rules, etc.) unless there is a need<br />for a particular order.<br /></div><br /></li><li>Use <em>ID_VENDOR</em> for rules matching<br /><br />Looking around the environment, it looks like the <em>ID_VENDOR</em> environment variable contains the vendor name in string form.  When the device is connected or removed, the vendor name is &quot;Yubico&quot;.  I just match on that, instead of matching on a vendor &amp; product ID.<br /><br />Here are the rules I'm using now:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">ACTION==&quot;remove&quot;, ENV{ID_VENDOR}==&quot;Yubico&quot;, RUN+=&quot;/usr/local/bin/gnome-screensaver-lock&quot;<br />ACTION==&quot;add&quot;, ENV{ID_VENDOR}==&quot;Yubico&quot;, RUN+=&quot;/usr/local/bin/gnome-screensaver-unlock&quot;</div><br /></li><li>Set <em>DBUS_SESSION_BUS_ADDRESS</em> for lock/poke command to work<br /><br />With the script provided, every time I tried to run it, I would get the error &quot;Screensaver not running&quot;, even though the gnome-screensaver process was running.<br /><br />After some testing, it appears that the <em>gnome-screensaver-command</em> command uses D-Bus for communications, and that it needs the <em>DBUS_SESSION_BUS_ADDRESS</em> environment variable set in order to know how to communicate with D-Bus.<br /><br /><em>DBUS_SESSION_BUS_ADDRESS</em> is set when D-Bus is launched, presumably on user login, but it isn't included as part of root's environment.  However, since the <em>gnome-screensaver</em> daemon process uses D-Bus, it must have the <em>DBUS_SESSION_BUS_ADDRESS</em> variable as part of its local environment.  Therefore, I added the following two lines to /usr/local/bin/gnome-screensaver-lock and /usr/local/bin/gnome-screensaver-unlock:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">GNOME_SCREENSAVER_PROC=`ps xa | grep gnome-screensaver | head -n 1 | perl -p -e '$_=join(&quot;,&quot;, (split)&#91;0&#93;);'`<br />export `grep -z DBUS_SESSION_BUS_ADDRESS /proc/$GNOME_SCREENSAVER_PROC/environ`</div><br /><br />The lines were added above the &quot;logger&quot; line, very close to the end of the file.<br /><br />The first line goes through the list of all processes on the system, looks for the gnome-screensaver process, and extracts the process ID (which should be the first number on the first line of the output).  This line is where things are likely to break on other systems, and I wouldn't be surprised if this breaks on systems where multiple users are logged in.<br /><br />The second line takes the discovered process ID, pulls the process's environment, pulls out the <em>DBUS_SESSION_BUS_ADDRESS</em> variable, and sticks it into the session's environment, to be used by the gnome-screensaver-command at the end of the script.</li></ul><br />That's it!  Once I did all of that, everything started working, and I really like it.  Thanks very much for making me aware of another way in which I can use my newly-purchased Yubikey!<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=1175">akkornel</a> — Tue Apr 27, 2010 12:55 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[greatguin]]></name></author>
<updated>2009-11-18T07:22:41+01:00</updated>
<published>2009-11-18T07:22:41+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=246&amp;p=1870#p1870</id>
<link href="https://forum.yubico.com/viewtopic.php?t=246&amp;p=1870#p1870"/>
<title type="html"><![CDATA[Re: [linux] Lock\Unlock system with Yubikey removal\insertion]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=246&amp;p=1870#p1870"><![CDATA[
I set this up but the remove rule didn't work. I'm running karmic which must have changes to udev. I fixed it by changing the remove rule:<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">ACTION==&quot;add&quot;, ATTRS{idVendor}==&quot;1050&quot;, ATTRS{idProduct}==&quot;0010&quot;, RUN+=&quot;/usr/local/bin/gnome-screensaver-unlock&quot;<br />ACTION==&quot;remove&quot;, ENV{ID_VENDOR_ID}==&quot;1050&quot;, ENV{ID_MODEL_ID}==&quot;0010&quot;, RUN+=&quot;/usr/local/bin/gnome-screensaver-lock&quot;</div><br />Also after restarting udev the lock unlock worked but my yubikey stopped generating passwords. Not sure why but I had to do a reboot.<br /><br />Oh ya, if you want to see what udev events occur when you plug/unplug the yubikey try this:<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">udevadm monitor --udev --environment</div><p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=951">greatguin</a> — Wed Nov 18, 2009 7:22 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[bmorgenthaler]]></name></author>
<updated>2009-01-29T20:07:35+01:00</updated>
<published>2009-01-29T20:07:35+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=246&amp;p=983#p983</id>
<link href="https://forum.yubico.com/viewtopic.php?t=246&amp;p=983#p983"/>
<title type="html"><![CDATA[[linux] Lock\Unlock system with Yubikey removal\insertion]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=246&amp;p=983#p983"><![CDATA[
I have setup my system with YubiPAM for local authentication and I wanted to go one step further.  The following information will make your system lock when your yubikey is removed and bring up the password prompt when you reinsert it.<br /><br />*** WARNING ***<br />If you are on a laptop DO NOT remove the uhci-hcd module to save power, if you do your screen will lock (the yubikey is removed now, right?) and you won't be able to reload the module to allow yourself to login.<br /><br />*** INSTRUCTIONS ***<br />1) Create /etc/udev/rules.d/45-yubikey.rules and put in the following lines.<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">ACTION==&quot;add&quot;, ATTRS{idVendor}==&quot;1050&quot;, ATTRS{idProduct}==&quot;0010&quot;, RUN+=&quot;/usr/local/bin/gnome-screensaver-unlock&quot;<br />ACTION==&quot;remove&quot;, ATTRS{idVendor}==&quot;1050&quot;, ATTRS{idProduct}==&quot;0010&quot;, RUN+=&quot;/usr/local/bin/gnome-screensaver-lock&quot;<br /></div><br /><br />2) Create /usr/local/bin/gnome-screensaver-lock and paste the following and chmod a+x the file<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">#!/bin/sh<br /><br />getXuser() {<br />        user=`finger| grep -m1 &quot;:$displaynum &quot; | awk '{print $1}'`<br /> <br />        if &#91; x&quot;$user&quot; = x&quot;&quot; &#93;; then<br />                user=`finger| grep -m1 &quot;:$displaynum&quot; | awk '{print $1}'`<br />        fi<br />        if &#91; x&quot;$user&quot; != x&quot;&quot; &#93;; then<br />                userhome=`getent passwd $user | cut -d: -f6`<br />                export XAUTHORITY=$userhome/.Xauthority<br />        else<br />                export XAUTHORITY=&quot;&quot;<br />        fi<br />}<br /><br />for x in /tmp/.X11-unix/*; do<br />    displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`<br />    getXuser<br />    if &#91; x&quot;$XAUTHORITY&quot; != x&quot;&quot; &#93;; then<br />        # extract current state<br />   export DISPLAY=&quot;:$displaynum&quot;<br />    fi<br />done<br /><br />logger &quot;YubiKey Removed - Locking Workstation&quot;<br />su $user -c &quot;/usr/bin/gnome-screensaver-command --lock&quot;<br /></div><br /><br />3) Create /usr/local/bin/gnome-screensaver-unlock and paste the following and chmod a+x the file<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">#!/bin/sh<br /><br />getXuser() {<br />        user=`finger| grep -m1 &quot;:$displaynum &quot; | awk '{print $1}'`<br /> <br />        if &#91; x&quot;$user&quot; = x&quot;&quot; &#93;; then<br />                user=`finger| grep -m1 &quot;:$displaynum&quot; | awk '{print $1}'`<br />        fi<br />        if &#91; x&quot;$user&quot; != x&quot;&quot; &#93;; then<br />                userhome=`getent passwd $user | cut -d: -f6`<br />                export XAUTHORITY=$userhome/.Xauthority<br />        else<br />                export XAUTHORITY=&quot;&quot;<br />        fi<br />}<br /><br />for x in /tmp/.X11-unix/*; do<br />    displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`<br />    getXuser<br />    if &#91; x&quot;$XAUTHORITY&quot; != x&quot;&quot; &#93;; then<br />        # extract current state<br />   export DISPLAY=&quot;:$displaynum&quot;<br />    fi<br />done<br /><br />logger &quot;YubiKey Inserted - Unlocking Workstation&quot;<br />su $user -c &quot;/usr/bin/gnome-screensaver-command --poke&quot;<br /></div><br /><br />4) Restart udev.<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">sudo /etc/init.d/udev restart<br /></div> or on older udev installs<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">sudo udevcontrol reload_rules<br /></div><br /><br />--<br />Brenden<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=315">bmorgenthaler</a> — Thu Jan 29, 2009 8:07 pm</p><hr />
]]></content>
</entry>
</feed>