Logon Failure locking policy configuration logon Timeout Policy disabling root remote login script

Source: Internet
Author: User

Logon Failure locking policy configuration logon Timeout Policy disabling root remote logon script [plain] #! /Bin/sh # set up login timeout #60 s donot do any operation, auto cancell # PROFILE_PATH = "/etc/profile" tmout = 'cat $ PROFILE_PATH | grep TMOUT 'if [-z "$ tmout"] then echo "TMOUT = 60">/ etc/profile else sed-I's/$ tmout/TMOUT = 60/'$ PROFILE_PATH fi source $ PROFILE_PATH if [$? -Eq 0]; then echo "set TMOUT = 60 successful! "Fi # Locking strategies enable to a logon failure PAM_AUTH_PATH ="/etc/pam. d/system-auth "system_auth = 'cat $ PAM_AUTH_PATH | grep pam_tally2.so 'content =" auth required pam_tally2.so deny = 10 unlock_time = 300 bytes root_unlock_time = 300 "if [-z" $ system_auth "] then sed-I" 3 a {$ content} "$ PAM_AUTH_PATH else sed-I" s/$ system_auth/$ content/"$ PAM_AUTH_PATH fi # Limit the root user login remotely SSH_CONF = "/etc/ssh/sshd_config" sed-I "s/^ # PermitRootLogin. */PermitRootLogin no/"$ SSH_CONF service sshd restart

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.