Can I edit login script? For I want to restrict the user to only have 3 login attempts. If the user fails to login in after 3 attempts, the system must shutdown.

Is this possible?


See file


This line should let someone have 3 attempts. It also unlocks after 21600 seconds (=6 hours).

auth required pam_tally.so onerr=fail deny=3 unlock_time=21600 

This will not shut down your system but have the user stay at the login screen with a notice (s)he can not login. I have not yet see a method where you can shut the system down after 3 failed loging attempts.

  • sir (Rinzwind)After doing modification to the common-auth. My system goes into low graphics mode.then there is no choice rather than reinstall the system .Is there any valid tested method or script, that help me out. – SachiN Feb 17 '13 at 19:02
  • where i can get the login script ?? – SachiN Feb 17 '13 at 19:45

I'm not sure if you can shutdown the system from PAM. You need something where you can call your own custom script when the user fails to log in.

Take a look at fail2ban, that looks like you can set up a custom action.

  • Sir actually i want it on single system. – SachiN Feb 17 '13 at 19:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.