根据D(x)宏在pam_macros.h (源代码)中定义并使用如下:
D(("Hello PAM World"));这个日志位于CentOS7上的哪里?
请注意,我在pam.d conf文件中使用作为标志pam.d。
我还尝试了以下命令:
grep -rnw '/var/log/' -e "Hello Pam World"但没有成功。
发布于 2015-09-23 14:00:20
在链接的文件中,顶部有以下几行:
/*
* This is for debugging purposes ONLY. DO NOT use on live systems !!!
* You have been warned :-) - CG
*
* to get automated debugging to the log file, it must be created manually.
* _PAM_LOGFILE must exist, mode 666
*/
#ifndef _PAM_LOGFILE
#define _PAM_LOGFILE "/tmp/pam-debug.log"
#endif因此,看起来输出将被定向到/tmp/pam-debug.log,但是您必须先创建它,并授予它完整的读-写权限:
$ touch /tmp/pam-debug.log
$ chmod 666 /tmp/pam-debug.log从这个文件的Linux版本来看,它似乎是写到/var/run/pam-debug.log上的,但前提是它是用PAM_DEBUG编译的。
在configure.ac中有一个很好的评论
if test x"$enable_debug" = x"yes" ; then
AC_DEFINE([PAM_DEBUG],,
[lots of stuff gets written to /var/run/pam-debug.log])https://stackoverflow.com/questions/32741574
复制相似问题