{"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":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.3 - aioseo.com -->\n\t<meta name=\"description\" content=\"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 - USERNAME -c &quot;xlock -display $DISP&quot; where USERNAME is the name\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"kargig\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.void.gr\/kargig\/blog\/2005\/04\/15\/more-fun-with-a-usb-key-pam_usb-hotplug-and-xlockmore\/\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.3\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2005\\\/04\\\/15\\\/more-fun-with-a-usb-key-pam_usb-hotplug-and-xlockmore\\\/#article\",\"name\":\"More fun with a usb key: pam_usb, hotplug and xlockmore | Into.the.Void.\",\"headline\":\"More fun with a usb key: pam_usb, hotplug and xlockmore\",\"author\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/author\\\/site-admin\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/#organization\"},\"datePublished\":\"2005-04-15T21:58:04+03:00\",\"dateModified\":\"2005-04-15T21:58:21+03:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2005\\\/04\\\/15\\\/more-fun-with-a-usb-key-pam_usb-hotplug-and-xlockmore\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2005\\\/04\\\/15\\\/more-fun-with-a-usb-key-pam_usb-hotplug-and-xlockmore\\\/#webpage\"},\"articleSection\":\"General, Linux\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2005\\\/04\\\/15\\\/more-fun-with-a-usb-key-pam_usb-hotplug-and-xlockmore\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/category\\\/general\\\/#listItem\",\"name\":\"General\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/category\\\/general\\\/#listItem\",\"position\":2,\"name\":\"General\",\"item\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/category\\\/general\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2005\\\/04\\\/15\\\/more-fun-with-a-usb-key-pam_usb-hotplug-and-xlockmore\\\/#listItem\",\"name\":\"More fun with a usb key: pam_usb, hotplug and xlockmore\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2005\\\/04\\\/15\\\/more-fun-with-a-usb-key-pam_usb-hotplug-and-xlockmore\\\/#listItem\",\"position\":3,\"name\":\"More fun with a usb key: pam_usb, hotplug and xlockmore\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/category\\\/general\\\/#listItem\",\"name\":\"General\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/#organization\",\"name\":\"Into.the.Void.\",\"description\":\"Into The Void\",\"url\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/\",\"sameAs\":[\"https:\\\/\\\/x.com\\\/kargig\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/author\\\/site-admin\\\/#author\",\"url\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/author\\\/site-admin\\\/\",\"name\":\"kargig\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2005\\\/04\\\/15\\\/more-fun-with-a-usb-key-pam_usb-hotplug-and-xlockmore\\\/#webpage\",\"url\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2005\\\/04\\\/15\\\/more-fun-with-a-usb-key-pam_usb-hotplug-and-xlockmore\\\/\",\"name\":\"More fun with a usb key: pam_usb, hotplug and xlockmore | Into.the.Void.\",\"description\":\"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 - USERNAME -c \\\"xlock -display $DISP\\\" where USERNAME is the name\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2005\\\/04\\\/15\\\/more-fun-with-a-usb-key-pam_usb-hotplug-and-xlockmore\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/author\\\/site-admin\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/author\\\/site-admin\\\/#author\"},\"datePublished\":\"2005-04-15T21:58:04+03:00\",\"dateModified\":\"2005-04-15T21:58:21+03:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/\",\"name\":\"Into.the.Void.\",\"description\":\"Into The Void\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"More fun with a usb key: pam_usb, hotplug and xlockmore | Into.the.Void.","description":"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 - USERNAME -c \"xlock -display $DISP\" where USERNAME is the name","canonical_url":"https:\/\/www.void.gr\/kargig\/blog\/2005\/04\/15\/more-fun-with-a-usb-key-pam_usb-hotplug-and-xlockmore\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.void.gr\/kargig\/blog\/2005\/04\/15\/more-fun-with-a-usb-key-pam_usb-hotplug-and-xlockmore\/#article","name":"More fun with a usb key: pam_usb, hotplug and xlockmore | Into.the.Void.","headline":"More fun with a usb key: pam_usb, hotplug and xlockmore","author":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/author\/site-admin\/#author"},"publisher":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/#organization"},"datePublished":"2005-04-15T21:58:04+03:00","dateModified":"2005-04-15T21:58:21+03:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/2005\/04\/15\/more-fun-with-a-usb-key-pam_usb-hotplug-and-xlockmore\/#webpage"},"isPartOf":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/2005\/04\/15\/more-fun-with-a-usb-key-pam_usb-hotplug-and-xlockmore\/#webpage"},"articleSection":"General, Linux"},{"@type":"BreadcrumbList","@id":"https:\/\/www.void.gr\/kargig\/blog\/2005\/04\/15\/more-fun-with-a-usb-key-pam_usb-hotplug-and-xlockmore\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.void.gr\/kargig\/blog\/#listItem","position":1,"name":"Home","item":"https:\/\/www.void.gr\/kargig\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.void.gr\/kargig\/blog\/category\/general\/#listItem","name":"General"}},{"@type":"ListItem","@id":"https:\/\/www.void.gr\/kargig\/blog\/category\/general\/#listItem","position":2,"name":"General","item":"https:\/\/www.void.gr\/kargig\/blog\/category\/general\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.void.gr\/kargig\/blog\/2005\/04\/15\/more-fun-with-a-usb-key-pam_usb-hotplug-and-xlockmore\/#listItem","name":"More fun with a usb key: pam_usb, hotplug and xlockmore"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.void.gr\/kargig\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.void.gr\/kargig\/blog\/2005\/04\/15\/more-fun-with-a-usb-key-pam_usb-hotplug-and-xlockmore\/#listItem","position":3,"name":"More fun with a usb key: pam_usb, hotplug and xlockmore","previousItem":{"@type":"ListItem","@id":"https:\/\/www.void.gr\/kargig\/blog\/category\/general\/#listItem","name":"General"}}]},{"@type":"Organization","@id":"https:\/\/www.void.gr\/kargig\/blog\/#organization","name":"Into.the.Void.","description":"Into The Void","url":"https:\/\/www.void.gr\/kargig\/blog\/","sameAs":["https:\/\/x.com\/kargig"]},{"@type":"Person","@id":"https:\/\/www.void.gr\/kargig\/blog\/author\/site-admin\/#author","url":"https:\/\/www.void.gr\/kargig\/blog\/author\/site-admin\/","name":"kargig"},{"@type":"WebPage","@id":"https:\/\/www.void.gr\/kargig\/blog\/2005\/04\/15\/more-fun-with-a-usb-key-pam_usb-hotplug-and-xlockmore\/#webpage","url":"https:\/\/www.void.gr\/kargig\/blog\/2005\/04\/15\/more-fun-with-a-usb-key-pam_usb-hotplug-and-xlockmore\/","name":"More fun with a usb key: pam_usb, hotplug and xlockmore | Into.the.Void.","description":"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 - USERNAME -c \"xlock -display $DISP\" where USERNAME is the name","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/2005\/04\/15\/more-fun-with-a-usb-key-pam_usb-hotplug-and-xlockmore\/#breadcrumblist"},"author":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/author\/site-admin\/#author"},"creator":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/author\/site-admin\/#author"},"datePublished":"2005-04-15T21:58:04+03:00","dateModified":"2005-04-15T21:58:21+03:00"},{"@type":"WebSite","@id":"https:\/\/www.void.gr\/kargig\/blog\/#website","url":"https:\/\/www.void.gr\/kargig\/blog\/","name":"Into.the.Void.","description":"Into The Void","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/#organization"}}]}},"aioseo_meta_data":{"post_id":"118","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2022-01-04 12:02:20","updated":"2026-10-21 09:07:52","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.void.gr\/kargig\/blog\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.void.gr\/kargig\/blog\/category\/general\/\" title=\"General\">General<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tMore fun with a usb key: pam_usb, hotplug and xlockmore\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.void.gr\/kargig\/blog\/"},{"label":"General","link":"https:\/\/www.void.gr\/kargig\/blog\/category\/general\/"},{"label":"More fun with a usb key: pam_usb, hotplug and xlockmore","link":"https:\/\/www.void.gr\/kargig\/blog\/2005\/04\/15\/more-fun-with-a-usb-key-pam_usb-hotplug-and-xlockmore\/"}],"views":4686,"_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}]}}