Make default user removal its own function

This commit is contained in:
Bob Mottram 2014-09-29 11:36:34 +01:00
parent d5241e7469
commit 1907dabcb2
1 changed files with 5 additions and 0 deletions

View File

@ -302,6 +302,9 @@ function argument_checks {
exit 30 exit 30
fi fi
fi fi
}
function remove_default_user {
# make sure you don't use the default user account # make sure you don't use the default user account
if [[ $MY_USERNAME == "debian" ]]; then if [[ $MY_USERNAME == "debian" ]]; then
echo 'Do not use the default debian user account. Create a different user with: adduser [username]' echo 'Do not use the default debian user account. Create a different user with: adduser [username]'
@ -310,6 +313,7 @@ function argument_checks {
# remove the default debian user to prevent it from becoming an attack vector # remove the default debian user to prevent it from becoming an attack vector
if [ -d /home/debian ]; then if [ -d /home/debian ]; then
userdel -r debian userdel -r debian
echo 'Default debian user account removed'
fi fi
} }
@ -3399,6 +3403,7 @@ function install_final {
} }
argument_checks argument_checks
remove_default_user
configure_firewall configure_firewall
configure_firewall_for_ssh configure_firewall_for_ssh
configure_firewall_for_dns configure_firewall_for_dns