Linux uses Pam to lock multiple logins to failed users

Source: Internet
Author: User

How to use Pam to lock multiple logon failed users in a Linux environment

Modify the following file:

/ETC/PAM.D/SSHD (remote SSH)

/etc/pam.d/login (terminal)


The contents are as follows:

#%pam-1.0auth Required pam_tally2.so deny=3 unlock_time=120 even_deny_root Root_unlock_time=1200auth required PAM_ faillock.so PreAuth Silent Audit deny=3 unlock_time=120auth sufficient pam_unix.so Nullok Try_first_passauth [Default=di E] pam_faillock.so authfail audit Deny=3account required pam_faillock.so

Under the first line, add the following #%pam-1.0:
Auth Required pam_tally2.so deny=3 unlock_time=600 even_deny_root root_unlock_time=1200

Explanation of each parameter:
Even_deny_root also restricts root users;

Deny sets the maximum number of consecutive error logins for regular users and root users, and the maximum number of times that the user is locked

Unlock_time set the normal user lock, how much time after unlocking, Unit is seconds;

Root_unlock_time set the root user lock, how much time after the unlock, the unit is seconds;


Linux uses Pam to lock multiple logins to failed users

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.