allan

SmartCards - xscreensaver Integration with card_eventmgr

Jul 18th, 2017
543
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.54 KB | None | 0 0
  1. # The following was performed on Debian Stretch
  2. #
  3. # Adapted from:
  4. #    https://github.com/OpenSC/pam_pkcs11/blob/master/doc/README.eventmgr
  5. #
  6. # Note: A working PAM integration is required. See:
  7. #    https://pastebin.com/cx6T3L9H
  8. # =====================================================================
  9.  
  10. # Create /etc/pam_pkcs11/card_eventmgr.conf
  11. # ---------------------------------------------------------------------
  12. card_eventmgr {
  13.  
  14.     # Run in background.
  15.     daemon = true;
  16.  
  17.     # show debug messages
  18.     debug = false;
  19.    
  20.     # polling time in mili-seconds
  21.     timeout = 1000;
  22.  
  23.     #
  24.     # list of events and actions
  25.  
  26.     # Card inserted
  27.     event card_insert {
  28.         # what to do if an action fail?
  29.         # ignore  : continue to next action
  30.         # return  : end action sequence
  31.         # quit    : end program
  32.         on_error = ignore ;
  33.  
  34.         # You can enter several, comma-separated action entries
  35.         # they will be executed in turn
  36.         action = "/usr/bin/xscreensaver-command -deactivate";
  37.     }
  38.  
  39.     # Card has been removed
  40.     event card_remove {
  41.         on_error = ignore;
  42.         action = "/usr/bin/xscreensaver-command -lock";
  43.     }
  44.  
  45.     # Too much time locked session
  46.     event timeout {
  47.     }
  48. }
  49.  
  50. # Start /usr/bin/card_eventmgr on login
  51. # ---------------------------------------------------------------------
  52. #
  53. # Option 1: ~/.xsession
  54. #
  55. # add /usr/bin/card_eventmgr to the ~/.xsession file
  56.  
  57. # Option 2: add to Window Manager
  58. #
  59. # Example in xfce4:
  60. # 1. Applications > Settings > Session and Startup
  61. # 2. Application Autostart tab > Add...
  62. # 3. Enter a description and "/usr/bin/card_eventmgr"
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment