![修改 /etc/pam.d/common-auth 的正确方法是什么?](https://linux22.com/image/978163/%E4%BF%AE%E6%94%B9%20%2Fetc%2Fpam.d%2Fcommon-auth%20%E7%9A%84%E6%AD%A3%E7%A1%AE%E6%96%B9%E6%B3%95%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%9F.png)
默认情况下/etc/pam.d/common-auth
看起来像这样
$ cat /etc/pam.d/common-auth
#
# /etc/pam.d/common-auth - authentication settings common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of the authentication modules that define
# the central authentication scheme for use on the system
# (e.g., /etc/shadow, LDAP, Kerberos, etc.). The default is to use the
# traditional Unix authentication mechanisms.
#
# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
# To take advantage of this, it is recommended that you configure any
# local modules either before or after the default block, and use
# pam-auth-update to manage selection of other modules. See
# pam-auth-update(8) for details.
# here are the per-package modules (the "Primary" block)
auth [success=1 default=ignore] pam_unix.so nullok_secure
# here's the fallback if no module succeeds
auth requisite pam_deny.so
# prime the stack with a positive return value if there isn't one already;
# this avoids us returning an error just because nothing sets a success code
# since the modules above will each just jump around
auth required pam_permit.so
# and here are more per-package modules (the "Additional" block)
auth optional pam_cap.so
# end of pam-auth-update config
我已经成功修改了上述文件附加
auth required pam_exec.so expose_authtok /path/to/some/script
我正在审查上述方法是否是修改 PAM 的推荐方法,或者我是否应该在中创建 PAM-config /usr/share/pam-configs/my-custom-thing
。
创建 PAM 配置是否是对 PAM 进行所需更改的正确方法?