From ffff8ca075fe3d0fb5839fcfd277e96373437974 Mon Sep 17 00:00:00 2001 From: akanealw Date: Fri, 20 Oct 2023 11:32:31 -0500 Subject: [PATCH] if then disable root --- debian/debian-essentials.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/debian-essentials.sh b/debian/debian-essentials.sh index 52c1f9b..0bd62e3 100755 --- a/debian/debian-essentials.sh +++ b/debian/debian-essentials.sh @@ -253,8 +253,14 @@ fi # lock root if [[ -d /home/akanealw ]] then - passwd -l root - skill -KILL -u root + isInFile=$(cat /etc/shadow | grep -c 'root:!') + if [ $isInFile -eq 0 ] + then + passwd -l root + skill -KILL -u root + else + "root account already disabled." + fi else echo "akanealw account not found, not locking root." fi