Hardware authentication for Linux using ordinary USB Flash Drives.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

262 lines
7.6 KiB

17 years ago
17 years ago
17 years ago
17 years ago
17 years ago
17 years ago
17 years ago
17 years ago
17 years ago
17 years ago
17 years ago
17 years ago
17 years ago
17 years ago
17 years ago
17 years ago
  1. ====== Configuration ======
  2. Configuration is done through the pamusb-conf tool, as explained in the
  3. [[quickstart]] section. Most users don't have to manually change pamusb.conf,
  4. however if you want to change some default settings, this document explains the
  5. syntax of the pamusb.conf configuration file.
  6. ===== Introduction =====
  7. * The configuration file is formatted in XML and subdivided in 4 sections:
  8. - Default options, shared among every device, user and service
  9. - Devices declaration and settings
  10. - Users declaration and settings
  11. - Services declaration and settings
  12. * The syntax is the following:
  13. <configuration>
  14. <defaults>
  15. <!-- default options -->
  16. </defaults>
  17. <devices>
  18. <!-- devices definitions -->
  19. </devices>
  20. <users>
  21. <!-- users definitions -->
  22. </users>
  23. <services>
  24. <!-- services definitions -->
  25. </services>
  26. </configuration>
  27. * Location of the configuration file
  28. By default, pam_usb.so and its tools will look for the configuration file
  29. located in /etc/pamusb.conf, but you can tell it to use a different file by
  30. using the -c option:
  31. # /etc/pam.d/common-auth
  32. auth sufficient pam_usb.so -c /some/other/path.conf
  33. auth required pam_unix.so nullok_secure
  34. You will also have to use the -c option when calling pam_usb's tools. For
  35. instance, when calling pamusb-agent:
  36. pamusb-agent -c /some/other/path.conf
  37. ===== Options =====
  38. ^ Name ^ Type ^ Default value ^ Description ^
  39. | enable | Boolean | true | Enable pam_usb
  40. |
  41. | debug | Boolean | false | Enable debug messages
  42. |
  43. | quiet | Boolean | false | Quiet mode (no verbose
  44. output) |
  45. | color_log | Boolean | true | Enable colored output
  46. |
  47. | one_time_pad | Boolean | true | Enable the use of one
  48. time pads |
  49. | probe_timeout | Time | 10s | Time to wait for the
  50. volume to be detected|
  51. | pad_expiration| Time | 1h | Time between pads
  52. regeneration|
  53. | hostname | String | Computer's hostname | Computer name. Must be
  54. unique accross computers using the same device |
  55. | system_pad_directory | String | .pamusb | Relative path to the
  56. user's home used to store one time pads |
  57. | device_pad_directory | String | .pamusb | Relative path to the
  58. device used to store one time pads|
  59. * Example:
  60. <configuration>
  61. <defaults>
  62. <!-- Disable colored output by default -->
  63. <option name="color_log">false</option>
  64. <!-- Enable debug output -->
  65. <option name="debug">true</option>
  66. </defaults>
  67. <users>
  68. <user id="root">
  69. <!-- Enable colored output for user "root" -->
  70. <option name="color_log">true</option>
  71. </user>
  72. <user id="scox">
  73. <!-- Disable debug output for user "scox" -->
  74. <option name="debug">false</option>
  75. </users>
  76. <devices>
  77. <device id="sandisk">
  78. <!-- Wait 15 seconds instead of the default 10 seconds for the "sandisk"
  79. device to be detected -->
  80. <option name="probe_timeout">15</option>
  81. </devices>
  82. <services>
  83. <service id="su">
  84. <!-- Disable pam_usb for "su" ("su" will ask for a password as usual) -->
  85. <option name="enable">false<option>
  86. </service>
  87. </services>
  88. </configuration>
  89. ===== Devices =====
  90. ^ Name ^ Type ^ Description ^
  91. Example ^
  92. | id | Attribute | Arbitrary device name |
  93. MyDevice |
  94. | vendor | Element | device's vendor name |
  95. SanDisk Corp. |
  96. | model | Element | device's model name |
  97. Cruzer Titanium |
  98. | serial | Element | serial number of the device |
  99. SNDKXXXXXXXXXXXXXXXX |
  100. | volume_uuid | Element | UUID of the device's volume used to store pads |
  101. 6F6B-42FC |
  102. * Example:
  103. <device id="MyDevice">
  104. <vendor>SanDisk Corp.</vendor>
  105. <model>Cruzer Titanium</model>
  106. <serial>SNDKXXXXXXXXXXXXXXXX</serial>
  107. <volume_uuid>6F6B-42FC</volume_uuid>
  108. </device>
  109. ===== Users =====
  110. ^ Name ^ Type ^ Description ^
  111. Example ^
  112. | id | Attribute | Login of the user | root
  113. |
  114. | device | Element | id of the device associated to the user |
  115. MyDevice |
  116. | agent | Element | Agent commands, for use with pamusb-agent | See
  117. below |
  118. * Example:
  119. <user id="scox">
  120. <device>MyDevice</device>
  121. <!-- When the user "scox" removes the usb device, lock the screen and pause
  122. beep-media-player -->
  123. <agent event="lock">gnome-screensaver-command --lock</agent>
  124. <agent event="lock">beep-media-player --pause</agent>
  125. <!-- Resume operations when the usb device is plugged back and authenticated -->
  126. <agent event="unlock">gnome-screensaver-command --deactivate</agent>
  127. <agent event="unlock">beep-media-player --play</agent>
  128. </user>
  129. ===== Services =====
  130. ^ Name ^ Type ^ Description ^ Example ^
  131. | id | Attribute | Name of the service | su |
  132. <service id="su">
  133. <!--
  134. Here you can put service specific options such as "enable", "debug" etc.
  135. See the options section of this document.
  136. -->
  137. </service>
  138. ===== Full example =====
  139. This example demonstrates how to write a pam_usb configuration file and how to
  140. combine and override options.
  141. <configuration>
  142. <!-- Default options -->
  143. <defaults>
  144. <!-- Enable debug output by default-->
  145. <option name="debug">true</option> -->
  146. <!-- Disable one time pads by default -->
  147. <option name="one_time_pad">false</option> -->
  148. </defaults>
  149. <!-- Device settings -->
  150. <devices>
  151. <device id="MyDevice">
  152. <!-- This part was generated by pamusb-conf -->
  153. <vendor>SanDisk Corp.</vendor>
  154. <model>Cruzer Titanium</model>
  155. <serial>SNDKXXXXXXXXXXXXXXXX</serial>
  156. <volume_uuid>6F6B-42FC</volume_uuid>
  157. <!--
  158. Override the debug option previously enabled by "defaults".
  159. Everytime a user associated to that device tries to authenticate,
  160. debugging will be disabled.
  161. For other users using different devices, the debugging will still be
  162. enabled.
  163. -->
  164. <option name="debug">disable</option>
  165. </device>
  166. </devices>
  167. <!-- User settings -->
  168. <users>
  169. <!-- Authenticate user "root" with device "MyDevice". -->
  170. <user id="root">
  171. <device>MyDevice</device>
  172. <!--
  173. One time pads were disabled in the "defaults" section.
  174. Now we want to enable them for the user "root" so we override the option:
  175. -->
  176. <option name="one_time_pad">true</option>
  177. </user>
  178. <!-- Authenticate user "scox" with device "MyDevice". -->
  179. <user id="scox">
  180. <device>MyDevice</device>
  181. <!-- We want pam_usb to work in quiet mode when authenticating "scox", so we
  182. override the "quiet" option -->
  183. <option name="quiet">true</option>
  184. <!-- Agent settings, used by pamusb-agent -->
  185. <agent event="lock">gnome-screensaver-command --lock</agent>
  186. <agent event="unlock">gnome-screensaver-command --deactivate</agent>
  187. </user>
  188. </users>
  189. <!-- Services settings (e.g. gdm, su, sudo...) -->
  190. <services>
  191. <!-- Disable pam_usb for gdm (a password will be asked as usual) -->
  192. <service id="gdm">
  193. <option name="enable">false</option>
  194. </service>
  195. <!--
  196. We already disabled one time pads in the defaults section, but then
  197. re-enabled them for the
  198. user "root" in the users section.
  199. Now we want to speed up console login for user root, so we simply override
  200. again the one_time_pad option
  201. for the "login" (console) service.
  202. -->
  203. <service id="login">
  204. <option name="one_time_pad">false</option>
  205. </service>
  206. </services>
  207. </configuration>
  208. </code>