How to run custom script on local login failure in a screen locking program using PAM

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I am trying to run a script every time a login failure occurs via a screen locking program (like SLiM, i3Lock, slock, etc.) I am running Arch.



Also, to be clear, I am not talking about logging into my user upon rebooting. I have already successfully implemented running my custom script on login failure for that. If it helps at all, here is my /etc/pam.d/system-auth file which implements that:



#%PAM-1.0

auth [success=1 default=bad] pam_unix.so try_first_pass nullok
auth optional pam_exec.so /usr/local/bin/my_custom_script
auth optional pam_permit.so
auth required pam_env.so

account required pam_unix.so
account optional pam_permit.so
account required pam_time.so

password required pam_unix.so try_first_pass nullok sha512 shadow
password optional pam_permit.so

session required pam_limits.so
session required pam_unix.so
session optional pam_permit.so






share|improve this question

























    up vote
    0
    down vote

    favorite












    I am trying to run a script every time a login failure occurs via a screen locking program (like SLiM, i3Lock, slock, etc.) I am running Arch.



    Also, to be clear, I am not talking about logging into my user upon rebooting. I have already successfully implemented running my custom script on login failure for that. If it helps at all, here is my /etc/pam.d/system-auth file which implements that:



    #%PAM-1.0

    auth [success=1 default=bad] pam_unix.so try_first_pass nullok
    auth optional pam_exec.so /usr/local/bin/my_custom_script
    auth optional pam_permit.so
    auth required pam_env.so

    account required pam_unix.so
    account optional pam_permit.so
    account required pam_time.so

    password required pam_unix.so try_first_pass nullok sha512 shadow
    password optional pam_permit.so

    session required pam_limits.so
    session required pam_unix.so
    session optional pam_permit.so






    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I am trying to run a script every time a login failure occurs via a screen locking program (like SLiM, i3Lock, slock, etc.) I am running Arch.



      Also, to be clear, I am not talking about logging into my user upon rebooting. I have already successfully implemented running my custom script on login failure for that. If it helps at all, here is my /etc/pam.d/system-auth file which implements that:



      #%PAM-1.0

      auth [success=1 default=bad] pam_unix.so try_first_pass nullok
      auth optional pam_exec.so /usr/local/bin/my_custom_script
      auth optional pam_permit.so
      auth required pam_env.so

      account required pam_unix.so
      account optional pam_permit.so
      account required pam_time.so

      password required pam_unix.so try_first_pass nullok sha512 shadow
      password optional pam_permit.so

      session required pam_limits.so
      session required pam_unix.so
      session optional pam_permit.so






      share|improve this question













      I am trying to run a script every time a login failure occurs via a screen locking program (like SLiM, i3Lock, slock, etc.) I am running Arch.



      Also, to be clear, I am not talking about logging into my user upon rebooting. I have already successfully implemented running my custom script on login failure for that. If it helps at all, here is my /etc/pam.d/system-auth file which implements that:



      #%PAM-1.0

      auth [success=1 default=bad] pam_unix.so try_first_pass nullok
      auth optional pam_exec.so /usr/local/bin/my_custom_script
      auth optional pam_permit.so
      auth required pam_env.so

      account required pam_unix.so
      account optional pam_permit.so
      account required pam_time.so

      password required pam_unix.so try_first_pass nullok sha512 shadow
      password optional pam_permit.so

      session required pam_limits.so
      session required pam_unix.so
      session optional pam_permit.so








      share|improve this question












      share|improve this question




      share|improve this question








      edited Jun 7 at 18:16









      jasonwryan

      46.5k14125174




      46.5k14125174









      asked Jun 7 at 0:01









      Grant Park

      1011




      1011

























          active

          oldest

          votes











          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',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f448311%2fhow-to-run-custom-script-on-local-login-failure-in-a-screen-locking-program-usin%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes










           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f448311%2fhow-to-run-custom-script-on-local-login-failure-in-a-screen-locking-program-usin%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay