{"id":2744,"date":"2022-12-20T15:17:11","date_gmt":"2022-12-20T18:17:11","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/pam_tcb-man8\/"},"modified":"2022-12-20T15:17:11","modified_gmt":"2022-12-20T18:17:11","slug":"pam_tcb-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/pam_tcb-man8\/","title":{"rendered":"PAM_TCB (man8)"},"content":{"rendered":"<h1 align=\"center\">PAM_TCB<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#OBTAINING PASSWORD HASHES\">OBTAINING PASSWORD HASHES<\/a><br \/> <a href=\"#BUGS\">BUGS<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>pam_tcb<\/b> \u2212 authentication, account, session, and password management PAM module for Unix with support for the tcb password shadowing scheme<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>pam_tcb<\/b> is a PAM module which deals with Unix accounts and provides functionality for all four PAM management groups: authentication, account management, session management, and password management. It is a successor to <b>pam_unix<\/b> and <b>pam_pwdb<\/b>. <b><br \/> authentication<\/b><\/p>\n<p style=\"margin-left:22%;\"><b>pam_tcb<\/b> relies exclusively on <b>getpwnam<\/b>(3) and <b>getspnam<\/b>(3) interfaces to obtain information necessary for user authentication. It performs password hashing with <b>crypt_ra<\/b>(3) or <b>crypt<\/b>(3). This means that <b>pam_tcb<\/b> will use NSS and will handle any password hashing method supported by the system libraries.<\/p>\n<p style=\"margin-left:11%;\"><b>account management<\/b><\/p>\n<p style=\"margin-left:22%;\">When the account information is available via <b>getspnam<\/b>(3), the account management part of <b>pam_tcb<\/b> checks for expired accounts or passwords. It uses the shadow file entry fields as described in <b>shadow<\/b>(5). It is responsibility of applications to interpret the PAM error status and possibly invoke the password management group to get an expired password changed.<\/p>\n<p style=\"margin-left:11%;\"><b>session management<\/b><\/p>\n<p style=\"margin-left:22%;\">By default, <b>pam_tcb<\/b> logs the opening and closing of PAM sessions via <b>syslog<\/b>(3). It uses <b>LOG_AUTH<\/b> as the syslog facility and either adds &#8220;pam_tcb: &#8221; prefix to log messages or, if the <b>openlog<\/b> option is given, sets the ident to &#8220;pam_tcb&#8221;. This functionality may be disabled with the <b>nolog<\/b> option (see below).<\/p>\n<p style=\"margin-left:11%;\"><b>password management<\/b><\/p>\n<p style=\"margin-left:22%;\"><b>pam_chauthtok<\/b>(3) performs two passes through the password management stack: <b>PAM_PRELIM_CHECK<\/b> and <b>PAM_UPDATE_AUTHTOK<\/b>. During the <b>PAM_PRELIM_CHECK<\/b> phase, <b>pam_tcb<\/b> may optionally prompt for and will always verify the old password. This allows for stacking of a password policy enforcement module such as <b>pam_passwdqc<\/b> before <b>pam_tcb<\/b>, without requiring this other module to take over performing any of the tasks of <b>pam_tcb<\/b>. The actual password change happens during the <b>PAM_UPDATE_AUTHTOK<\/b> phase.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">When changing passwords, <b>pam_tcb<\/b> is able to modify the following password databases:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><i>\/etc\/passwd<\/i> file, see <b>passwd<\/b>(5); <i><br \/> \/etc\/shadow<\/i> file, see <b>shadow<\/b>(5); <i><br \/> \/etc\/tcb\/<\/i> directory structure, see <b>tcb<\/b>(5); <br \/> NIS and NIS+.<\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Most of the options recognized by <b>pam_unix<\/b> or <b>pam_pwdb<\/b> are valid for <b>pam_tcb<\/b> as well and have identical meaning. There are some semantic differences though, so you are advised to browse the list below. All the boolean options are off by default. The default values of non-boolean options are given.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"7%\">\n<p><b>debug<\/b><\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"78%\">\n<p>Log debugging information via <b>syslog<\/b>(3).<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"7%\">\n<p><b>audit<\/b><\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"78%\">\n<p>Log even more debugging information, including unknown usernames. This has the risk of potentially logging a password that a user could have given instead of a username.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>openlog<\/b><\/p>\n<p style=\"margin-left:22%;\">Normally, <b>pam_tcb<\/b> will add &#8220;pam_tcb: &#8221; prefix to log messages. The <b>openlog<\/b> option disables this behavior and causes <b>pam_tcb<\/b> to call <b>openlog<\/b>(3) with ident &#8220;pam_tcb&#8221; before logging and <b>closelog<\/b>(3) afterwards.<\/p>\n<p style=\"margin-left:11%;\"><b>noopenlog<\/b><\/p>\n<p style=\"margin-left:22%;\">If <b>pam_tcb<\/b> was compiled with ENABLE_OPENLOG, it will call <b>openlog<\/b>(3) with ident &#8220;pam_tcb&#8221; before logging and <b>closelog<\/b>(3) afterwards. The <b>noopenlog<\/b> option disables this behavior.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"7%\">\n<p><b>nolog<\/b><\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"26%\">\n<p>Suppress logging.<\/p>\n<\/td>\n<td width=\"52%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>blank_nolog<\/b><\/p>\n<p style=\"margin-left:22%;\">Do not log failed authentication attempts when a blank password is tried. If this option is not used, some services, notably <b>sshd<\/b>(8), may generate false alarms.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>nullok<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"35%\">\n<p>Permit blank passwords.<\/p>\n<\/td>\n<td width=\"43%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>use_first_pass<\/b><\/p>\n<p style=\"margin-left:22%;\">Don\u2019t prompt the user for passwords, take them from <b>PAM_AUTHTOK<\/b> and possibly <b>PAM_OLDAUTHTOK<\/b> items instead.<\/p>\n<p style=\"margin-left:11%;\"><b>try_first_pass<\/b><\/p>\n<p style=\"margin-left:22%;\">Take passwords from <b>PAM_AUTHTOK<\/b> and possibly <b>PAM_OLDAUTHTOK<\/b> items, but prompt the user if the appropriate PAM item is unset.<\/p>\n<p style=\"margin-left:11%;\"><b>use_authtok<\/b><\/p>\n<p style=\"margin-left:22%;\">Like <b>use_first_pass<\/b>, but applies to the (new) <b>PAM_AUTHTOK<\/b> only. This is intended for stacking password management modules.<\/p>\n<p style=\"margin-left:11%;\"><b>not_set_pass<\/b><\/p>\n<p style=\"margin-left:22%;\">Don\u2019t set the PAM items with passwords used by this module.<\/p>\n<p style=\"margin-left:11%;\"><b>likeauth<\/b><\/p>\n<p style=\"margin-left:22%;\">When called as a credential setting module, return the same value as was returned during the authentication.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>passwd<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>If set, <b>pam_tcb<\/b> may use the second field of user\u2019s &#8220;passwd&#8221; entry (usually taken from <i>\/etc\/passwd<\/i>) as the password hash. See below for details.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>shadow<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>If set, <b>pam_tcb<\/b> may use the second field of user\u2019s &#8220;shadow&#8221; entry (usually taken from <i>\/etc\/shadow<\/i> or a tcb shadow file) as the password hash. See below for details.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>nisplus<\/b><\/p>\n<p style=\"margin-left:22%;\">If set, <b>pam_tcb<\/b> will acquire the user\u2019s EUID before obtaining the password hash. If you\u2019re using NIS+, you need to turn this on. See below for details.<\/p>\n<p style=\"margin-left:11%;\"><b>write_to<\/b>=<\/p>\n<p style=\"margin-left:22%;\">This option determines where <b>pam_tcb<\/b> should store new password hashes when changing passwords. Possible settings are: &#8220;passwd&#8221;, &#8220;shadow&#8221;, &#8220;tcb&#8221;, and &#8220;nis&#8221;. The default is &#8220;shadow&#8221;.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"4%\">\n<p><b>md5<\/b><\/p>\n<\/td>\n<td width=\"7%\"><\/td>\n<td width=\"78%\">\n<p>When updating a user\u2019s password, hash the new password with the obsolete FreeBSD-derived MD5-based algorithm.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>prefix<\/b>=<\/p>\n<p style=\"margin-left:22%;\">When updating a user\u2019s password, generate the salt with the specified <i>prefix<\/i> (which determines the hashing method to use). The default is &#8220;$2y$&#8221;, which requests <b>bcrypt<\/b>, a Blowfish-based hashing method, which supports variable iteration counts.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>count<\/b>=<\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>The number of iterations of an underlying cryptographic primitive to use when hashing passwords. The default is 0, which lets the selected hashing algorithm pick its default iteration count.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:22%; margin-top: 1em\">It is highly recommended that you override this setting. Please refer to <b>crypt<\/b>(3) for information on supported hashing methods, their <i>prefix<\/i> strings, and their <i>count<\/i> settings.<\/p>\n<p style=\"margin-left:11%;\"><b>plain_crypt<\/b><\/p>\n<p style=\"margin-left:22%;\">Use plain <b>crypt<\/b>(3) instead of <b>crypt_ra<\/b>(3). This may be required to access hashing methods for which no reentrant implementation exists in the system libraries.<\/p>\n<p style=\"margin-left:11%;\"><b>nodelay<\/b><\/p>\n<p style=\"margin-left:22%;\">Do not delay after an unsuccessful authentication attempt.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"6%\">\n<p><b>fork<\/b><\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"78%\">\n<p>Create child processes for accessing shadow files. Using this option one can be sure that after a call to <b>pam_end<\/b>(3) there is no sensitive data left in the process\u2019 address space. However, this option may confuse some of the more complicated applications and it has some performance overhead.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>helper<\/b>=<\/p>\n<p style=\"margin-left:22%;\">If the hashed password cannot be retrieved by <b>pam_tcb<\/b> and the UID of the user being authenticated is equal to the real UID <b>pam_tcb<\/b> runs as, <b>pam_tcb<\/b> will execute a privileged helper program to perform authentication. This option determines path to the program\u2019s binary. If an empty helper path is given, no helper will be executed. The default is <i>\/usr\/libexec\/chkpwd\/tcb_chkpwd<\/i>.<\/p>\n<h2>OBTAINING PASSWORD HASHES <a name=\"OBTAINING PASSWORD HASHES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The following algorithm is used by <b>pam_tcb<\/b> to retrieve the password hash for a user:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">if (<b>passwd<\/b> option is set and <b>pw_passwd<\/b> field is not equal to &#8220;x&#8221; nor &#8220;*NP*&#8221;)<\/p>\n<p style=\"margin-left:29%;\">use <b>pw_passwd<\/b> field as the hash;<\/p>\n<p style=\"margin-left:17%;\">if (<b>nisplus<\/b> option is set) {<\/p>\n<p style=\"margin-left:29%;\">try to acquire EUID of the user; if unsuccessful, fail; <br \/> obtain the <b>struct spwd<\/b> for the user with <b>getspnam<\/b>(3); <br \/> regain the previous EUID; <br \/> use <b>sp_pwdp<\/b> field as the hash;<\/p>\n<p style=\"margin-left:17%;\">} <br \/> if (<b>shadow<\/b> option is set and <b>pw_passwd<\/b> field is equal to &#8220;x&#8221;)<\/p>\n<p style=\"margin-left:29%;\">use <b>sp_pwdp<\/b> field as the hash;<\/p>\n<p style=\"margin-left:17%;\">if all the above failed, fail.<\/p>\n<h2>BUGS <a name=\"BUGS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The current <b>pam_tcb<\/b> implementation is not thread-safe (just like <b>pam_unix<\/b> and <b>pam_pwdb<\/b>).<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>crypt<\/b>(3), <b>crypt_ra<\/b>(3), <b>getpwnam<\/b>(3), <b>getspnam<\/b>(3), <b>shadow<\/b>(3), <b>login.defs<\/b>(5), <b>passwd<\/b>(5), <b>shadow<\/b>(5), <b>tcb<\/b>(5), <b>pam<\/b>(8), <b>tcb_convert<\/b>(8)<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  pam_tcb \u2212 authentication, account, session, and password management PAM module for Unix with support for the tcb password shadowing scheme <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,4,98],"class_list":["post-2744","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-man8","tag-pam_tcb"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/2744","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=2744"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/2744\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=2744"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=2744"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=2744"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}