allan

SmartCards - xscreensaver Integration with pkcs11_eventmgr

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