{"id":118,"date":"2005-04-15T21:58:04","date_gmt":"2005-04-15T18:58:04","guid":{"rendered":"https:\/\/void.gr\/kargig\/blog\/?p=118"},"modified":"2005-04-15T21:58:21","modified_gmt":"2005-04-15T18:58:21","slug":"more-fun-with-a-usb-key-pam_usb-hotplug-and-xlockmore","status":"publish","type":"post","link":"https:\/\/www.void.gr\/kargig\/blog\/2005\/04\/15\/more-fun-with-a-usb-key-pam_usb-hotplug-and-xlockmore\/","title":{"rendered":"More fun with a usb key: pam_usb, hotplug and xlockmore"},"content":{"rendered":"<p>Uncle sivitos introduced the idea of using hotplug with the usb key. So here we go:<\/p>\n<p>Insert this to your sysctl<br \/>\n<code>kernel.hotplug = \/usr\/bin\/usbhotplug<\/code><br \/>\nand then emerge xlockmore.<br \/>\nNow go to your \/etc\/pam_usb\/handlers\/xlock.sh, and edit it so the start function looks like this:<br \/>\n<code>su - USERNAME -c \"xlock -display $DISP\"<\/code><\/p>\n<p>where USERNAME is the name of the user that you start X with&#8230;you don&#8217;t still use X as root&#8230;do you ?<\/p>\n<p>Now plug and unplug the usb key to see what happens. Normally when you unplug it your X session should be locked and you should be asked for a password. Then , when you plug your usb key back in &#8230; you should be able to return in your X session after 1-2 seconds of delay. Try it and tell me whether it works for you too \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Uncle sivitos introduced the idea of using hotplug with the usb key. So here we go: Insert this to your sysctl kernel.hotplug = \/usr\/bin\/usbhotplug and then emerge xlockmore. Now go to your \/etc\/pam_usb\/handlers\/xlock.sh, and edit it so the start function looks like this: su &#8211; USERNAME -c &#8220;xlock -display $DISP&#8221; where USERNAME is the name [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ep_exclude_from_search":false,"footnotes":""},"categories":[1,3],"tags":[],"class_list":["post-118","post","type-post","status-publish","format-standard","hentry","category-general","category-linux"],"aioseo_notices":[],"views":4315,"_links":{"self":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/comments?post=118"}],"version-history":[{"count":0,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/118\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/media?parent=118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/categories?post=118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/tags?post=118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}