{"id":3807,"date":"2022-12-20T17:20:08","date_gmt":"2022-12-20T20:20:08","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/pam_exec-man8\/"},"modified":"2022-12-20T17:20:08","modified_gmt":"2022-12-20T20:20:08","slug":"pam_exec-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/pam_exec-man8\/","title":{"rendered":"PAM_EXEC (man8)"},"content":{"rendered":"<h1 align=\"center\">PAM_EXEC<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#MODULE TYPES PROVIDED\">MODULE TYPES PROVIDED<\/a><br \/> <a href=\"#RETURN VALUES\">RETURN VALUES<\/a><br \/> <a href=\"#EXAMPLES\">EXAMPLES<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">pam_exec \u2212 PAM module which calls an external command<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\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=\"89%\">\n<p style=\"margin-top: 1em\"><b>pam_exec.so<\/b> [debug] [expose_authtok] [seteuid] [quiet] [stdout] [log=<i>file<\/i>] [type=<i>type<\/i>] <i>command<\/i> [<i>&#8230;<\/i>]<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">pam_exec is a PAM module that can be used to run an external command.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The child&#8217;s environment is set to the current PAM environment list, as returned by <b>pam_getenvlist<\/b>(3) In addition, the following PAM items are exported as environment variables: <i>PAM_RHOST<\/i>, <i>PAM_RUSER<\/i>, <i>PAM_SERVICE<\/i>, <i>PAM_TTY<\/i>, <i>PAM_USER<\/i> and <i>PAM_TYPE<\/i>, which contains one of the module types: <b>account<\/b>, <b>auth<\/b>, <b>password<\/b>, <b>open_session<\/b> and <b>close_session<\/b>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Commands called by pam_exec need to be aware of that the user can have controll over the environment.<\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>debug<\/b><\/p>\n<p style=\"margin-left:17%;\">Print debug information.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>expose_authtok<\/b><\/p>\n<p style=\"margin-left:17%;\">During authentication the calling command can read the password from <b>stdin<\/b>(3). Only first <i>PAM_MAX_RESP_SIZE<\/i> bytes of a password are provided to the command.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>log=<\/b><i>file<\/i><\/p>\n<p style=\"margin-left:17%;\">The output of the command is appended to file<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>type=<\/b><i>type<\/i><\/p>\n<p style=\"margin-left:17%;\">Only run the command if the module type matches the given type.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>stdout<\/b><\/p>\n<p style=\"margin-left:17%;\">Per default the output of the executed command is written to \/dev\/null. With this option, the stdout output of the executed command is redirected to the calling application. It&#8217;s in the responsibility of this application what happens with the output. The <b>log<\/b> option is ignored.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>quiet<\/b><\/p>\n<p style=\"margin-left:17%;\">Per default pam_exec.so will echo the exit status of the external command if it fails. Specifying this option will suppress the message.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>seteuid<\/b><\/p>\n<p style=\"margin-left:17%;\">Per default pam_exec.so will execute the external command with the real user ID of the calling process. Specifying this option means the command is run with the effective user ID.<\/p>\n<h2>MODULE TYPES PROVIDED <a name=\"MODULE TYPES PROVIDED\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">All module types (<b>auth<\/b>, <b>account<\/b>, <b>password<\/b> and <b>session<\/b>) are provided.<\/p>\n<h2>RETURN VALUES <a name=\"RETURN VALUES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">PAM_SUCCESS<\/p>\n<p style=\"margin-left:17%;\">The external command was run successfully.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">PAM_SERVICE_ERR<\/p>\n<p style=\"margin-left:17%;\">No argument or a wrong number of arguments were given.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">PAM_SYSTEM_ERR<\/p>\n<p style=\"margin-left:17%;\">A system error occurred or the command to execute failed.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">PAM_IGNORE<\/p>\n<p style=\"margin-left:17%;\"><b>pam_setcred<\/b> was called, which does not execute the command. Or, the value given for the type= parameter did not match the module type.<\/p>\n<h2>EXAMPLES <a name=\"EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Add the following line to \/etc\/pam.d\/passwd to rebuild the NIS database after each local password change:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">password optional pam_exec.so seteuid \/usr\/bin\/make \u2212C \/var\/yp<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">This will execute the command<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">make \u2212C \/var\/yp<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">with effective user ID.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>pam.conf<\/b>(5), <b>pam.d<\/b>(5), <b>pam<\/b>(8)<\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">pam_exec was written by Thorsten Kukuk <kukuk@thkukuk.de> and Josh Triplett <josh@joshtriplett.org>.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  pam_exec \u2212 PAM module which calls an external command <\/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,905],"class_list":["post-3807","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-man8","tag-pam_exec"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3807","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=3807"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3807\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3807"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3807"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3807"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}