Skip to content

Commit e22f8e6

Browse files
committed
doc: update documentation and comments
1 parent fc05ad5 commit e22f8e6

1 file changed

Lines changed: 12 additions & 20 deletions

File tree

  • hardening/SSHD Hardening

hardening/SSHD Hardening/sshd

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
#
88
# Version: v1.1.2
99
# License: MIT License
10-
# Copyright (c) 2020-2023 Hunter T. (StrangeRanger)
10+
# Copyright (c) 2020-2024 Hunter T. (StrangeRanger)
1111
#
1212
########################################################################################
13-
#### [ Variables ]
13+
####[ Script Wide Variables ]###########################################################
1414

1515

1616
config_file_bak="/etc/ssh/sshd_config.bak"
@@ -21,27 +21,25 @@ red="$(printf '\033[1;31m')"
2121
nc="$(printf '\033[0m')"
2222

2323

24-
#### End of [ Variables ]
25-
########################################################################################
26-
#### [ Functions ]
24+
####[ Functions ]#######################################################################
2725

2826

29-
########
27+
####
3028
# Cleanly exit the script.
3129
#
3230
# Arguments:
33-
# $1 - required
34-
# Exit status code.
35-
########
31+
# - $1: exit_code (Required)
32+
# - Description: The exit code to exit the script with.
33+
####
3634
clean_up() {
35+
local exit_code="$1"
36+
3737
echo -e "\nExiting..."
38-
exit "$1"
38+
exit "$exit_code"
3939
}
4040

4141

42-
#### End of [ Functions ]
43-
########################################################################################
44-
#### [ Prepping ]
42+
####[ Prepping ]########################################################################
4543

4644

4745
## Check if the script was executed with root privilege.
@@ -58,9 +56,7 @@ if [[ ! -f $config_file ]]; then
5856
fi
5957

6058

61-
#### End of [ Prepping ]
62-
########################################################################################
63-
#### [ Main ]
59+
####[ Main ]###########################################################################
6460

6561

6662
read -rp "We will now harden sshd. Press [Enter] to continue."
@@ -244,7 +240,3 @@ echo -e "${cyan}It is highly recommended to manually:
244240
1) Change the default sshd port (22)
245241
2) Disable PasswordAuthentication in favor of PubkeyAuthentication
246242
3) Add 'AllowUsers [your username]' to the bottom of 'sshd_config'${nc}"
247-
248-
249-
#### End of [ Main ]
250-
########################################################################################

0 commit comments

Comments
 (0)