PAM doesn't block my account after 5 failed logins












0















I would like to block account after 5 failed password on login screen. I follow this article but it doesn't takes effect. I don't know why. This is the content of my /etc/pam.d/system-auth file :



#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required pam_env.so
auth required pam_faillock.so preauth silent audit deny=5 even_deny_root unlock_time=9999999
auth sufficient pam_fprintd.so
auth sufficient pam_unix.so nullok try_first_pass
auth [default=die] pam_faillock.so authfail audit deny=5 even_deny_root unlock_time=99999999
auth requisite pam_succeed_if.so uid >= 500 quiet
auth required pam_deny.so
auth required pam_tally.so onerr=succeed deny=5 even_deny_root_account

account required pam_unix.so
account sufficient pam_localuser.so
account sufficient pam_succeed_if.so uid < 500 quiet
account required pam_permit.so
account required pam_faillock.so
password requisite pam_cracklib.so try_first_pass retry=5 minlen=8 minclass=3 max_repeat=1 difok=5 dcredit=1 ucredit=1 lcredit=1 ocredit=1 maxrepeat=1 gecoscheck enforce_for_root type=
password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
password required pam_deny.so

session optional pam_keyinit.so revoke
session required pam_limits.so
session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session required pam_unix.so


This is the content of my /etc/pam.d/password-auth :



#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required pam_env.so
auth required pam_faillock.so preauth silent audit deny=5 unlock_time=99999
auth sufficient pam_unix.so nullok try_first_pass
auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=99999
auth requisite pam_succeed_if.so uid >= 500 quiet
auth required pam_deny.so

account required pam_unix.so
account sufficient pam_localuser.so
account sufficient pam_succeed_if.so uid < 500 quiet
account required pam_permit.so
account required pam_faillock.so

password requisite pam_cracklib.so try_first_pass retry=3 type=
password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
password required pam_deny.so

session optional pam_keyinit.so revoke
session required pam_limits.so
session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session required pam_unix.so


I use CentOS 6.5, pam says that there is 0 failures.
EDIT :
The account is locked after 5 try but if I restart the computer, the account is unlocked... Why ?










share|improve this question









New contributor




Anonyme is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Which distro you using? What version? And pam_tally2 --user "youraccountname' gives what?

    – Babin Lonston
    Jan 9 at 10:33













  • PAM locks the account of a specific amount of time or until you restart the server as PAM is designed to lock the account temporaly, not permanently.

    – Dasel
    Jan 9 at 13:39
















0















I would like to block account after 5 failed password on login screen. I follow this article but it doesn't takes effect. I don't know why. This is the content of my /etc/pam.d/system-auth file :



#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required pam_env.so
auth required pam_faillock.so preauth silent audit deny=5 even_deny_root unlock_time=9999999
auth sufficient pam_fprintd.so
auth sufficient pam_unix.so nullok try_first_pass
auth [default=die] pam_faillock.so authfail audit deny=5 even_deny_root unlock_time=99999999
auth requisite pam_succeed_if.so uid >= 500 quiet
auth required pam_deny.so
auth required pam_tally.so onerr=succeed deny=5 even_deny_root_account

account required pam_unix.so
account sufficient pam_localuser.so
account sufficient pam_succeed_if.so uid < 500 quiet
account required pam_permit.so
account required pam_faillock.so
password requisite pam_cracklib.so try_first_pass retry=5 minlen=8 minclass=3 max_repeat=1 difok=5 dcredit=1 ucredit=1 lcredit=1 ocredit=1 maxrepeat=1 gecoscheck enforce_for_root type=
password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
password required pam_deny.so

session optional pam_keyinit.so revoke
session required pam_limits.so
session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session required pam_unix.so


This is the content of my /etc/pam.d/password-auth :



#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required pam_env.so
auth required pam_faillock.so preauth silent audit deny=5 unlock_time=99999
auth sufficient pam_unix.so nullok try_first_pass
auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=99999
auth requisite pam_succeed_if.so uid >= 500 quiet
auth required pam_deny.so

account required pam_unix.so
account sufficient pam_localuser.so
account sufficient pam_succeed_if.so uid < 500 quiet
account required pam_permit.so
account required pam_faillock.so

password requisite pam_cracklib.so try_first_pass retry=3 type=
password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
password required pam_deny.so

session optional pam_keyinit.so revoke
session required pam_limits.so
session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session required pam_unix.so


I use CentOS 6.5, pam says that there is 0 failures.
EDIT :
The account is locked after 5 try but if I restart the computer, the account is unlocked... Why ?










share|improve this question









New contributor




Anonyme is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Which distro you using? What version? And pam_tally2 --user "youraccountname' gives what?

    – Babin Lonston
    Jan 9 at 10:33













  • PAM locks the account of a specific amount of time or until you restart the server as PAM is designed to lock the account temporaly, not permanently.

    – Dasel
    Jan 9 at 13:39














0












0








0








I would like to block account after 5 failed password on login screen. I follow this article but it doesn't takes effect. I don't know why. This is the content of my /etc/pam.d/system-auth file :



#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required pam_env.so
auth required pam_faillock.so preauth silent audit deny=5 even_deny_root unlock_time=9999999
auth sufficient pam_fprintd.so
auth sufficient pam_unix.so nullok try_first_pass
auth [default=die] pam_faillock.so authfail audit deny=5 even_deny_root unlock_time=99999999
auth requisite pam_succeed_if.so uid >= 500 quiet
auth required pam_deny.so
auth required pam_tally.so onerr=succeed deny=5 even_deny_root_account

account required pam_unix.so
account sufficient pam_localuser.so
account sufficient pam_succeed_if.so uid < 500 quiet
account required pam_permit.so
account required pam_faillock.so
password requisite pam_cracklib.so try_first_pass retry=5 minlen=8 minclass=3 max_repeat=1 difok=5 dcredit=1 ucredit=1 lcredit=1 ocredit=1 maxrepeat=1 gecoscheck enforce_for_root type=
password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
password required pam_deny.so

session optional pam_keyinit.so revoke
session required pam_limits.so
session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session required pam_unix.so


This is the content of my /etc/pam.d/password-auth :



#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required pam_env.so
auth required pam_faillock.so preauth silent audit deny=5 unlock_time=99999
auth sufficient pam_unix.so nullok try_first_pass
auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=99999
auth requisite pam_succeed_if.so uid >= 500 quiet
auth required pam_deny.so

account required pam_unix.so
account sufficient pam_localuser.so
account sufficient pam_succeed_if.so uid < 500 quiet
account required pam_permit.so
account required pam_faillock.so

password requisite pam_cracklib.so try_first_pass retry=3 type=
password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
password required pam_deny.so

session optional pam_keyinit.so revoke
session required pam_limits.so
session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session required pam_unix.so


I use CentOS 6.5, pam says that there is 0 failures.
EDIT :
The account is locked after 5 try but if I restart the computer, the account is unlocked... Why ?










share|improve this question









New contributor




Anonyme is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I would like to block account after 5 failed password on login screen. I follow this article but it doesn't takes effect. I don't know why. This is the content of my /etc/pam.d/system-auth file :



#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required pam_env.so
auth required pam_faillock.so preauth silent audit deny=5 even_deny_root unlock_time=9999999
auth sufficient pam_fprintd.so
auth sufficient pam_unix.so nullok try_first_pass
auth [default=die] pam_faillock.so authfail audit deny=5 even_deny_root unlock_time=99999999
auth requisite pam_succeed_if.so uid >= 500 quiet
auth required pam_deny.so
auth required pam_tally.so onerr=succeed deny=5 even_deny_root_account

account required pam_unix.so
account sufficient pam_localuser.so
account sufficient pam_succeed_if.so uid < 500 quiet
account required pam_permit.so
account required pam_faillock.so
password requisite pam_cracklib.so try_first_pass retry=5 minlen=8 minclass=3 max_repeat=1 difok=5 dcredit=1 ucredit=1 lcredit=1 ocredit=1 maxrepeat=1 gecoscheck enforce_for_root type=
password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
password required pam_deny.so

session optional pam_keyinit.so revoke
session required pam_limits.so
session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session required pam_unix.so


This is the content of my /etc/pam.d/password-auth :



#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required pam_env.so
auth required pam_faillock.so preauth silent audit deny=5 unlock_time=99999
auth sufficient pam_unix.so nullok try_first_pass
auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=99999
auth requisite pam_succeed_if.so uid >= 500 quiet
auth required pam_deny.so

account required pam_unix.so
account sufficient pam_localuser.so
account sufficient pam_succeed_if.so uid < 500 quiet
account required pam_permit.so
account required pam_faillock.so

password requisite pam_cracklib.so try_first_pass retry=3 type=
password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
password required pam_deny.so

session optional pam_keyinit.so revoke
session required pam_limits.so
session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session required pam_unix.so


I use CentOS 6.5, pam says that there is 0 failures.
EDIT :
The account is locked after 5 try but if I restart the computer, the account is unlocked... Why ?







security login authentication pam






share|improve this question









New contributor




Anonyme is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Anonyme is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Jan 9 at 13:34







Anonyme













New contributor




Anonyme is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Jan 9 at 9:50









AnonymeAnonyme

32




32




New contributor




Anonyme is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Anonyme is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Anonyme is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • Which distro you using? What version? And pam_tally2 --user "youraccountname' gives what?

    – Babin Lonston
    Jan 9 at 10:33













  • PAM locks the account of a specific amount of time or until you restart the server as PAM is designed to lock the account temporaly, not permanently.

    – Dasel
    Jan 9 at 13:39



















  • Which distro you using? What version? And pam_tally2 --user "youraccountname' gives what?

    – Babin Lonston
    Jan 9 at 10:33













  • PAM locks the account of a specific amount of time or until you restart the server as PAM is designed to lock the account temporaly, not permanently.

    – Dasel
    Jan 9 at 13:39

















Which distro you using? What version? And pam_tally2 --user "youraccountname' gives what?

– Babin Lonston
Jan 9 at 10:33







Which distro you using? What version? And pam_tally2 --user "youraccountname' gives what?

– Babin Lonston
Jan 9 at 10:33















PAM locks the account of a specific amount of time or until you restart the server as PAM is designed to lock the account temporaly, not permanently.

– Dasel
Jan 9 at 13:39





PAM locks the account of a specific amount of time or until you restart the server as PAM is designed to lock the account temporaly, not permanently.

– Dasel
Jan 9 at 13:39










3 Answers
3






active

oldest

votes


















0














Your config looks correct as far as I can tell.



But if your using ssh to login, make sure UsePAM is set to yes in your sshd_config file. Otherwise all things PAM are ignored for ssh logins! And it defaults to no.






share|improve this answer
























  • No, I don't use ssh, I just want to block on CentOS login screen.

    – Anonyme
    Jan 9 at 10:37



















0














I suppose that you have restarted the system in order to apply all the changes, otherwise the login application could not be recognising the changes.



You have to also apply the restrictions in the /etc/pam.d/login file to be sure that PAM will block the access after unsuccessful logins in every cases as each PAM module has different purpouses.



login: Rules for local login.



system-auth: Common rules for many services.



password-auth: Common rules for many remote services.



sshd: Rules for SSHD daemon only.






share|improve this answer








New contributor




Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




























    0














    I finded the good order and good syntax. I make severals tests and finnaly it works. Maybe the problem was a typing error.
    So this is the PAM's parameters to block a user after 5 try on lock screen.
    The parameters contains also some rules to prevent too simple password changing.



    Note : The counter is reset when computer restarts.



    /etc/pam.d/system-auth :



    #%PAM-1.0
    # This file is auto-generated.
    # User changes will be destroyed the next time authconfig is run.
    auth required pam_env.so
    auth required pam_faillock.so preauth silent audit deny=5 even_deny_root unlock_time=99999
    auth sufficient pam_fprintd.so
    auth sufficient pam_unix.so nullok try_first_pass
    auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=99999
    auth requisite pam_succeed_if.so uid >= 500 quiet
    auth required pam_deny.so

    account required pam_unix.so
    account sufficient pam_localuser.so
    account sufficient pam_succeed_if.so uid < 500 quiet
    account required pam_permit.so
    account required pam_faillock.so

    password requisite pam_cracklib.so try_first_pass retry=5 minlen=8 minclass=3 max_repeat=1 difok=5 dcredit=1 ucredit=1 lcredit=1 ocredit=1 maxrepeat=1 gecoscheck enforce_for_root type=
    password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
    password required pam_deny.so

    session optional pam_keyinit.so revoke
    session required pam_limits.so
    session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
    session required pam_unix.so


    Content of /etc/pam.d/password-auth :



    #%PAM-1.0
    # This file is auto-generated.
    # User changes will be destroyed the next time authconfig is run.
    auth required pam_env.so
    auth required pam_faillock.so preauth silent audit deny=5 unlock_time=99999
    auth sufficient pam_unix.so nullok try_first_pass
    auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=99999
    auth requisite pam_succeed_if.so uid >= 500 quiet
    auth required pam_deny.so

    account required pam_unix.so
    account sufficient pam_localuser.so
    account sufficient pam_succeed_if.so uid < 500 quiet
    account required pam_permit.so
    account required pam_faillock.so

    password requisite pam_cracklib.so try_first_pass retry=5 minlen=8 minclass=3 max_repeat=1 difok=5 dcredit=1 ucredit=1 lcredit=1 ocredit=1 maxrepeat=1 gecoscheck enforce_for_root type=
    password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
    password required pam_deny.so

    session optional pam_keyinit.so revoke
    session required pam_limits.so
    session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
    session required pam_unix.so





    share|improve this answer








    New contributor




    Anonyme is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.




















      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "106"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });






      Anonyme is a new contributor. Be nice, and check out our Code of Conduct.










      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f493428%2fpam-doesnt-block-my-account-after-5-failed-logins%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      Your config looks correct as far as I can tell.



      But if your using ssh to login, make sure UsePAM is set to yes in your sshd_config file. Otherwise all things PAM are ignored for ssh logins! And it defaults to no.






      share|improve this answer
























      • No, I don't use ssh, I just want to block on CentOS login screen.

        – Anonyme
        Jan 9 at 10:37
















      0














      Your config looks correct as far as I can tell.



      But if your using ssh to login, make sure UsePAM is set to yes in your sshd_config file. Otherwise all things PAM are ignored for ssh logins! And it defaults to no.






      share|improve this answer
























      • No, I don't use ssh, I just want to block on CentOS login screen.

        – Anonyme
        Jan 9 at 10:37














      0












      0








      0







      Your config looks correct as far as I can tell.



      But if your using ssh to login, make sure UsePAM is set to yes in your sshd_config file. Otherwise all things PAM are ignored for ssh logins! And it defaults to no.






      share|improve this answer













      Your config looks correct as far as I can tell.



      But if your using ssh to login, make sure UsePAM is set to yes in your sshd_config file. Otherwise all things PAM are ignored for ssh logins! And it defaults to no.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Jan 9 at 10:25









      HkoofHkoof

      1,07768




      1,07768













      • No, I don't use ssh, I just want to block on CentOS login screen.

        – Anonyme
        Jan 9 at 10:37



















      • No, I don't use ssh, I just want to block on CentOS login screen.

        – Anonyme
        Jan 9 at 10:37

















      No, I don't use ssh, I just want to block on CentOS login screen.

      – Anonyme
      Jan 9 at 10:37





      No, I don't use ssh, I just want to block on CentOS login screen.

      – Anonyme
      Jan 9 at 10:37













      0














      I suppose that you have restarted the system in order to apply all the changes, otherwise the login application could not be recognising the changes.



      You have to also apply the restrictions in the /etc/pam.d/login file to be sure that PAM will block the access after unsuccessful logins in every cases as each PAM module has different purpouses.



      login: Rules for local login.



      system-auth: Common rules for many services.



      password-auth: Common rules for many remote services.



      sshd: Rules for SSHD daemon only.






      share|improve this answer








      New contributor




      Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.

























        0














        I suppose that you have restarted the system in order to apply all the changes, otherwise the login application could not be recognising the changes.



        You have to also apply the restrictions in the /etc/pam.d/login file to be sure that PAM will block the access after unsuccessful logins in every cases as each PAM module has different purpouses.



        login: Rules for local login.



        system-auth: Common rules for many services.



        password-auth: Common rules for many remote services.



        sshd: Rules for SSHD daemon only.






        share|improve this answer








        New contributor




        Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.























          0












          0








          0







          I suppose that you have restarted the system in order to apply all the changes, otherwise the login application could not be recognising the changes.



          You have to also apply the restrictions in the /etc/pam.d/login file to be sure that PAM will block the access after unsuccessful logins in every cases as each PAM module has different purpouses.



          login: Rules for local login.



          system-auth: Common rules for many services.



          password-auth: Common rules for many remote services.



          sshd: Rules for SSHD daemon only.






          share|improve this answer








          New contributor




          Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.










          I suppose that you have restarted the system in order to apply all the changes, otherwise the login application could not be recognising the changes.



          You have to also apply the restrictions in the /etc/pam.d/login file to be sure that PAM will block the access after unsuccessful logins in every cases as each PAM module has different purpouses.



          login: Rules for local login.



          system-auth: Common rules for many services.



          password-auth: Common rules for many remote services.



          sshd: Rules for SSHD daemon only.







          share|improve this answer








          New contributor




          Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          share|improve this answer



          share|improve this answer






          New contributor




          Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          answered Jan 9 at 10:59









          DaselDasel

          3817




          3817




          New contributor




          Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





          New contributor





          Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.






          Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.























              0














              I finded the good order and good syntax. I make severals tests and finnaly it works. Maybe the problem was a typing error.
              So this is the PAM's parameters to block a user after 5 try on lock screen.
              The parameters contains also some rules to prevent too simple password changing.



              Note : The counter is reset when computer restarts.



              /etc/pam.d/system-auth :



              #%PAM-1.0
              # This file is auto-generated.
              # User changes will be destroyed the next time authconfig is run.
              auth required pam_env.so
              auth required pam_faillock.so preauth silent audit deny=5 even_deny_root unlock_time=99999
              auth sufficient pam_fprintd.so
              auth sufficient pam_unix.so nullok try_first_pass
              auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=99999
              auth requisite pam_succeed_if.so uid >= 500 quiet
              auth required pam_deny.so

              account required pam_unix.so
              account sufficient pam_localuser.so
              account sufficient pam_succeed_if.so uid < 500 quiet
              account required pam_permit.so
              account required pam_faillock.so

              password requisite pam_cracklib.so try_first_pass retry=5 minlen=8 minclass=3 max_repeat=1 difok=5 dcredit=1 ucredit=1 lcredit=1 ocredit=1 maxrepeat=1 gecoscheck enforce_for_root type=
              password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
              password required pam_deny.so

              session optional pam_keyinit.so revoke
              session required pam_limits.so
              session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
              session required pam_unix.so


              Content of /etc/pam.d/password-auth :



              #%PAM-1.0
              # This file is auto-generated.
              # User changes will be destroyed the next time authconfig is run.
              auth required pam_env.so
              auth required pam_faillock.so preauth silent audit deny=5 unlock_time=99999
              auth sufficient pam_unix.so nullok try_first_pass
              auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=99999
              auth requisite pam_succeed_if.so uid >= 500 quiet
              auth required pam_deny.so

              account required pam_unix.so
              account sufficient pam_localuser.so
              account sufficient pam_succeed_if.so uid < 500 quiet
              account required pam_permit.so
              account required pam_faillock.so

              password requisite pam_cracklib.so try_first_pass retry=5 minlen=8 minclass=3 max_repeat=1 difok=5 dcredit=1 ucredit=1 lcredit=1 ocredit=1 maxrepeat=1 gecoscheck enforce_for_root type=
              password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
              password required pam_deny.so

              session optional pam_keyinit.so revoke
              session required pam_limits.so
              session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
              session required pam_unix.so





              share|improve this answer








              New contributor




              Anonyme is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.

























                0














                I finded the good order and good syntax. I make severals tests and finnaly it works. Maybe the problem was a typing error.
                So this is the PAM's parameters to block a user after 5 try on lock screen.
                The parameters contains also some rules to prevent too simple password changing.



                Note : The counter is reset when computer restarts.



                /etc/pam.d/system-auth :



                #%PAM-1.0
                # This file is auto-generated.
                # User changes will be destroyed the next time authconfig is run.
                auth required pam_env.so
                auth required pam_faillock.so preauth silent audit deny=5 even_deny_root unlock_time=99999
                auth sufficient pam_fprintd.so
                auth sufficient pam_unix.so nullok try_first_pass
                auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=99999
                auth requisite pam_succeed_if.so uid >= 500 quiet
                auth required pam_deny.so

                account required pam_unix.so
                account sufficient pam_localuser.so
                account sufficient pam_succeed_if.so uid < 500 quiet
                account required pam_permit.so
                account required pam_faillock.so

                password requisite pam_cracklib.so try_first_pass retry=5 minlen=8 minclass=3 max_repeat=1 difok=5 dcredit=1 ucredit=1 lcredit=1 ocredit=1 maxrepeat=1 gecoscheck enforce_for_root type=
                password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
                password required pam_deny.so

                session optional pam_keyinit.so revoke
                session required pam_limits.so
                session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
                session required pam_unix.so


                Content of /etc/pam.d/password-auth :



                #%PAM-1.0
                # This file is auto-generated.
                # User changes will be destroyed the next time authconfig is run.
                auth required pam_env.so
                auth required pam_faillock.so preauth silent audit deny=5 unlock_time=99999
                auth sufficient pam_unix.so nullok try_first_pass
                auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=99999
                auth requisite pam_succeed_if.so uid >= 500 quiet
                auth required pam_deny.so

                account required pam_unix.so
                account sufficient pam_localuser.so
                account sufficient pam_succeed_if.so uid < 500 quiet
                account required pam_permit.so
                account required pam_faillock.so

                password requisite pam_cracklib.so try_first_pass retry=5 minlen=8 minclass=3 max_repeat=1 difok=5 dcredit=1 ucredit=1 lcredit=1 ocredit=1 maxrepeat=1 gecoscheck enforce_for_root type=
                password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
                password required pam_deny.so

                session optional pam_keyinit.so revoke
                session required pam_limits.so
                session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
                session required pam_unix.so





                share|improve this answer








                New contributor




                Anonyme is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.























                  0












                  0








                  0







                  I finded the good order and good syntax. I make severals tests and finnaly it works. Maybe the problem was a typing error.
                  So this is the PAM's parameters to block a user after 5 try on lock screen.
                  The parameters contains also some rules to prevent too simple password changing.



                  Note : The counter is reset when computer restarts.



                  /etc/pam.d/system-auth :



                  #%PAM-1.0
                  # This file is auto-generated.
                  # User changes will be destroyed the next time authconfig is run.
                  auth required pam_env.so
                  auth required pam_faillock.so preauth silent audit deny=5 even_deny_root unlock_time=99999
                  auth sufficient pam_fprintd.so
                  auth sufficient pam_unix.so nullok try_first_pass
                  auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=99999
                  auth requisite pam_succeed_if.so uid >= 500 quiet
                  auth required pam_deny.so

                  account required pam_unix.so
                  account sufficient pam_localuser.so
                  account sufficient pam_succeed_if.so uid < 500 quiet
                  account required pam_permit.so
                  account required pam_faillock.so

                  password requisite pam_cracklib.so try_first_pass retry=5 minlen=8 minclass=3 max_repeat=1 difok=5 dcredit=1 ucredit=1 lcredit=1 ocredit=1 maxrepeat=1 gecoscheck enforce_for_root type=
                  password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
                  password required pam_deny.so

                  session optional pam_keyinit.so revoke
                  session required pam_limits.so
                  session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
                  session required pam_unix.so


                  Content of /etc/pam.d/password-auth :



                  #%PAM-1.0
                  # This file is auto-generated.
                  # User changes will be destroyed the next time authconfig is run.
                  auth required pam_env.so
                  auth required pam_faillock.so preauth silent audit deny=5 unlock_time=99999
                  auth sufficient pam_unix.so nullok try_first_pass
                  auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=99999
                  auth requisite pam_succeed_if.so uid >= 500 quiet
                  auth required pam_deny.so

                  account required pam_unix.so
                  account sufficient pam_localuser.so
                  account sufficient pam_succeed_if.so uid < 500 quiet
                  account required pam_permit.so
                  account required pam_faillock.so

                  password requisite pam_cracklib.so try_first_pass retry=5 minlen=8 minclass=3 max_repeat=1 difok=5 dcredit=1 ucredit=1 lcredit=1 ocredit=1 maxrepeat=1 gecoscheck enforce_for_root type=
                  password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
                  password required pam_deny.so

                  session optional pam_keyinit.so revoke
                  session required pam_limits.so
                  session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
                  session required pam_unix.so





                  share|improve this answer








                  New contributor




                  Anonyme is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.










                  I finded the good order and good syntax. I make severals tests and finnaly it works. Maybe the problem was a typing error.
                  So this is the PAM's parameters to block a user after 5 try on lock screen.
                  The parameters contains also some rules to prevent too simple password changing.



                  Note : The counter is reset when computer restarts.



                  /etc/pam.d/system-auth :



                  #%PAM-1.0
                  # This file is auto-generated.
                  # User changes will be destroyed the next time authconfig is run.
                  auth required pam_env.so
                  auth required pam_faillock.so preauth silent audit deny=5 even_deny_root unlock_time=99999
                  auth sufficient pam_fprintd.so
                  auth sufficient pam_unix.so nullok try_first_pass
                  auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=99999
                  auth requisite pam_succeed_if.so uid >= 500 quiet
                  auth required pam_deny.so

                  account required pam_unix.so
                  account sufficient pam_localuser.so
                  account sufficient pam_succeed_if.so uid < 500 quiet
                  account required pam_permit.so
                  account required pam_faillock.so

                  password requisite pam_cracklib.so try_first_pass retry=5 minlen=8 minclass=3 max_repeat=1 difok=5 dcredit=1 ucredit=1 lcredit=1 ocredit=1 maxrepeat=1 gecoscheck enforce_for_root type=
                  password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
                  password required pam_deny.so

                  session optional pam_keyinit.so revoke
                  session required pam_limits.so
                  session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
                  session required pam_unix.so


                  Content of /etc/pam.d/password-auth :



                  #%PAM-1.0
                  # This file is auto-generated.
                  # User changes will be destroyed the next time authconfig is run.
                  auth required pam_env.so
                  auth required pam_faillock.so preauth silent audit deny=5 unlock_time=99999
                  auth sufficient pam_unix.so nullok try_first_pass
                  auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=99999
                  auth requisite pam_succeed_if.so uid >= 500 quiet
                  auth required pam_deny.so

                  account required pam_unix.so
                  account sufficient pam_localuser.so
                  account sufficient pam_succeed_if.so uid < 500 quiet
                  account required pam_permit.so
                  account required pam_faillock.so

                  password requisite pam_cracklib.so try_first_pass retry=5 minlen=8 minclass=3 max_repeat=1 difok=5 dcredit=1 ucredit=1 lcredit=1 ocredit=1 maxrepeat=1 gecoscheck enforce_for_root type=
                  password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
                  password required pam_deny.so

                  session optional pam_keyinit.so revoke
                  session required pam_limits.so
                  session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
                  session required pam_unix.so






                  share|improve this answer








                  New contributor




                  Anonyme is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  share|improve this answer



                  share|improve this answer






                  New contributor




                  Anonyme is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered Jan 9 at 15:43









                  AnonymeAnonyme

                  32




                  32




                  New contributor




                  Anonyme is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  Anonyme is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  Anonyme is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






















                      Anonyme is a new contributor. Be nice, and check out our Code of Conduct.










                      draft saved

                      draft discarded


















                      Anonyme is a new contributor. Be nice, and check out our Code of Conduct.













                      Anonyme is a new contributor. Be nice, and check out our Code of Conduct.












                      Anonyme is a new contributor. Be nice, and check out our Code of Conduct.
















                      Thanks for contributing an answer to Unix & Linux Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f493428%2fpam-doesnt-block-my-account-after-5-failed-logins%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

                      is 'sed' thread safe

                      How to make a Squid Proxy server?