Make that it works in 90% of the cases. 3:30.
This commit is contained in:
4
harden
4
harden
@@ -114,7 +114,7 @@ services=()
|
||||
|
||||
# The hardenSSH function will use sed to modify the sshd_config file to have the following settings:
|
||||
# - Allow ssh access to users in the sudo group only
|
||||
# - Change the port to 22121 if it is available
|
||||
# - Change the port to 22100 if it is available
|
||||
# - Configure idle timeout to 5 minutes
|
||||
# - Limit the number of authentication attempts to 3
|
||||
# - Disable root login
|
||||
@@ -134,7 +134,7 @@ function hardenSSH {
|
||||
if [[ -e /etc/ssh/sshd_config ]] && [[ -r /etc/ssh/sshd_config ]]; then
|
||||
sed -i \
|
||||
-e 's/^#AllowGroups.*/AllowGroups sudo/' \
|
||||
-e 's/^#Port.*/Port 22121/' \
|
||||
-e 's/^#Port.*/Port 22100/' \
|
||||
-e 's/^#ClientAliveInterval.*/ClientAliveInterval 300/' \
|
||||
-e 's/^#ClientAliveCountMax.*/ClientAliveCountMax 3/' \
|
||||
-e 's/^#PermitRootLogin.*/PermitRootLogin no/' \
|
||||
|
||||
Reference in New Issue
Block a user