Não é mais possível autenticar depois de adicionar uma linha ao common-auth

0

Eu segui o conselho on-line para definir um script que seria executado após uma tentativa de senha com falha. Eu adicionei a linha em /etc/pam.d/common-auth

auth    [default=ignore]                pam_exec.so seteuid /root/script

depois da linha

auth    [success=1 default=ignore]  pam_unix.so nullok_secure

Agora não consigo fazer login com nenhum usuário:

$ su root
Password: 
su: Authentication failure

Por que não consigo mais conectar-me a esta nova linha?

Arquivo completo ( /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
auth    [default=ignore]                pam_exec.so seteuid /root/script
# 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)
    
por user203771 04.12.2016 / 16:40

1 resposta

0

success=1 significa que, no sucesso, o PAM deve pular o próximo módulo e ir para o seguinte ... que é pam_deny.so . Inserindo um módulo entre pam_unix e pam_deny , a contagem de saltos foi alterada. Use success=2 para pam_unix.so se você quiser adicionar um módulo para ser executado após a falha.

    
por muru 21.02.2017 / 15:09