In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Centos how to limit the number of SSH login, I believe that many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.
The first method: verified.
1.ssh timeout setting
# cd / etc/profile.d/ # create two blank files autologout.csh and autologout.sh to save the TMOUT configuration
# touch autologout.csh
# touch autologout.sh
# vi autologout.sh # Editing autologout.sh
# auto out in 5 minutes
TMOUT=300 # timeout in s
Readonly TMOUT # set the TMOUT variable read-only
Export TMOUT # set environment TMOUT
# vi autologout.csh # Editing autologout.csh
Set-r autologout 2
# chmod + x autologout.* # executable permissions, in fact, just give Ubunx.
Disconnect Client, log in to the terminal again for 5 minutes without using ssh will automatically disconnect.
2. Limit the number of ssh authentication:
/ etc/ssh/sshd_config
MaxAuthTries=3 this is only more than 3 validation errors disconnecting.
The second method: (there are still problems in the experiment)
Principle: realized through the pam authentication of the system.
1. Backup / etc/pam.d/system_auth file, change:
#% 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_unix.so nullok try_first_pass changed the original sufficient to required
# auth requisite pam_succeed_if.so uid > = 500quiet comment out this line
Add one line to auth required pam_tally.so deny=3unlock_time=300 and log in after 5 minutes after 3 failures.
# auth required pam_deny.so comment out this line
Account required pam_unix.so
Account sufficient pam_succeed_if.so uid
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.