README 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. pam_unix — Module for traditional password authentication
  2. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  3. DESCRIPTION
  4. This is the standard Unix authentication module. It uses standard calls from
  5. the system's libraries to retrieve and set account information as well as
  6. authentication. Usually this is obtained from the /etc/passwd and the /etc/
  7. shadow file as well if shadow is enabled.
  8. The account component performs the task of establishing the status of the
  9. user's account and password based on the following shadow elements: expire,
  10. last_change, max_change, min_change, warn_change. In the case of the latter, it
  11. may offer advice to the user on changing their password or, through the
  12. PAM_AUTHTOKEN_REQD return, delay giving service to the user until they have
  13. established a new password. The entries listed above are documented in the
  14. shadow(5) manual page. Should the user's record not contain one or more of
  15. these entries, the corresponding shadow check is not performed.
  16. The authentication component performs the task of checking the users
  17. credentials (password). The default action of this module is to not permit the
  18. user access to a service if their official password is blank.
  19. A helper binary, unix_chkpwd(8), is provided to check the user's password when
  20. it is stored in a read protected database. This binary is very simple and will
  21. only check the password of the user invoking it. It is called transparently on
  22. behalf of the user by the authenticating component of this module. In this way
  23. it is possible for applications like xlock(1) to work without being
  24. setuid-root. The module, by default, will temporarily turn off SIGCHLD handling
  25. for the duration of execution of the helper binary. This is generally the right
  26. thing to do, as many applications are not prepared to handle this signal from a
  27. child they didn't know was fork()d. The noreap module argument can be used to
  28. suppress this temporary shielding and may be needed for use with certain
  29. applications.
  30. The maximum length of a password supported by the pam_unix module via the
  31. helper binary is PAM_MAX_RESP_SIZE - currently 512 bytes. The rest of the
  32. password provided by the conversation function to the module will be ignored.
  33. The password component of this module performs the task of updating the user's
  34. password. The default encryption hash is taken from the ENCRYPT_METHOD variable
  35. from /etc/login.defs
  36. The session component of this module logs when a user logins or leave the
  37. system.
  38. Remaining arguments, supported by others functions of this module, are silently
  39. ignored. Other arguments are logged as errors through syslog(3).
  40. OPTIONS
  41. debug
  42. Turns on debugging via syslog(3).
  43. audit
  44. A little more extreme than debug.
  45. quiet
  46. Turns off informational messages namely messages about session open and
  47. close via syslog(3).
  48. nullok
  49. The default action of this module is to not permit the user access to a
  50. service if their official password is blank. The nullok argument overrides
  51. this default.
  52. nullresetok
  53. Allow users to authenticate with blank password if password reset is
  54. enforced even if nullok is not set. If password reset is not required and
  55. nullok is not set the authentication with blank password will be denied.
  56. try_first_pass
  57. Before prompting the user for their password, the module first tries the
  58. previous stacked module's password in case that satisfies this module as
  59. well.
  60. use_first_pass
  61. The argument use_first_pass forces the module to use a previous stacked
  62. modules password and will never prompt the user - if no password is
  63. available or the password is not appropriate, the user will be denied
  64. access.
  65. nodelay
  66. This argument can be used to discourage the authentication component from
  67. requesting a delay should the authentication as a whole fail. The default
  68. action is for the module to request a delay-on-failure of the order of two
  69. second.
  70. use_authtok
  71. When password changing enforce the module to set the new password to the
  72. one provided by a previously stacked password module (this is used in the
  73. example of the stacking of the pam_passwdqc module documented below).
  74. authtok_type=type
  75. This argument can be used to modify the password prompt when changing
  76. passwords to include the type of the password. Empty by default.
  77. nis
  78. NIS RPC is used for setting new passwords.
  79. remember=n
  80. The last n passwords for each user are saved in /etc/security/opasswd in
  81. order to force password change history and keep the user from alternating
  82. between the same password too frequently. The MD5 password hash algorithm
  83. is used for storing the old passwords. Instead of this option the
  84. pam_pwhistory module should be used.
  85. shadow
  86. Try to maintain a shadow based system.
  87. md5
  88. When a user changes their password next, encrypt it with the MD5 algorithm.
  89. bigcrypt
  90. When a user changes their password next, encrypt it with the DEC C2
  91. algorithm.
  92. sha256
  93. When a user changes their password next, encrypt it with the SHA256
  94. algorithm. The SHA256 algorithm must be supported by the crypt(3) function.
  95. sha512
  96. When a user changes their password next, encrypt it with the SHA512
  97. algorithm. The SHA512 algorithm must be supported by the crypt(3) function.
  98. blowfish
  99. When a user changes their password next, encrypt it with the blowfish
  100. algorithm. The blowfish algorithm must be supported by the crypt(3)
  101. function.
  102. gost_yescrypt
  103. When a user changes their password next, encrypt it with the gost-yescrypt
  104. algorithm. The gost-yescrypt algorithm must be supported by the crypt(3)
  105. function.
  106. yescrypt
  107. When a user changes their password next, encrypt it with the yescrypt
  108. algorithm. The yescrypt algorithm must be supported by the crypt(3)
  109. function.
  110. rounds=n
  111. Set the optional number of rounds of the SHA256, SHA512, blowfish,
  112. gost-yescrypt, and yescrypt password hashing algorithms to n.
  113. broken_shadow
  114. Ignore errors reading shadow information for users in the account
  115. management module.
  116. minlen=n
  117. Set a minimum password length of n characters. The max. for DES crypt based
  118. passwords are 8 characters.
  119. no_pass_expiry
  120. When set ignore password expiration as defined by the shadow entry of the
  121. user. The option has an effect only in case pam_unix was not used for the
  122. authentication or it returned authentication failure meaning that other
  123. authentication source or method succeeded. The example can be public key
  124. authentication in sshd. The module will return PAM_SUCCESS instead of
  125. eventual PAM_NEW_AUTHTOK_REQD or PAM_AUTHTOK_EXPIRED.
  126. Invalid arguments are logged with syslog(3).
  127. EXAMPLES
  128. An example usage for /etc/pam.d/login would be:
  129. # Authenticate the user
  130. auth required pam_unix.so
  131. # Ensure users account and password are still active
  132. account required pam_unix.so
  133. # Change the user's password, but at first check the strength
  134. # with pam_passwdqc(8)
  135. password required pam_passwdqc.so config=/etc/passwdqc.conf
  136. password required pam_unix.so use_authtok nullok yescrypt
  137. session required pam_unix.so
  138. AUTHOR
  139. pam_unix was written by various people.