Limit the number of user logins
This commit is contained in:
parent
c24e7a4d0c
commit
35d789f133
|
@ -393,6 +393,22 @@ function set_max_login_tries {
|
|||
fi
|
||||
}
|
||||
|
||||
function limit_user_logins {
|
||||
# overall max logins
|
||||
if ! grep '* hard maxsyslogins' /etc/security/limits.conf; then
|
||||
echo '* hard maxsyslogins 10' >> /etc/security/limits.conf
|
||||
else
|
||||
sed -i 's|hard maxsyslogins.*|hard maxsyslogins 10|g' /etc/security/limits.conf
|
||||
fi
|
||||
|
||||
# Max logins for each user
|
||||
if ! grep '* hard maxlogins' /etc/security/limits.conf; then
|
||||
echo '* hard maxlogins 2' >> /etc/security/limits.conf
|
||||
else
|
||||
sed -i 's|hard maxlogins.*|hard maxlogins 2|g' /etc/security/limits.conf
|
||||
fi
|
||||
}
|
||||
|
||||
function setup_firewall {
|
||||
function_check create_completion_file
|
||||
create_completion_file
|
||||
|
@ -587,6 +603,9 @@ function setup_utils {
|
|||
|
||||
function_check admin_user_sudo
|
||||
admin_user_sudo
|
||||
|
||||
function_check limit_user_logins
|
||||
limit_user_logins
|
||||
}
|
||||
|
||||
function setup_email {
|
||||
|
|
Loading…
Reference in New Issue