if then disable root

This commit is contained in:
2023-10-20 11:32:31 -05:00
parent f1645f0965
commit ffff8ca075

View File

@@ -252,9 +252,15 @@ fi
# lock root # lock root
if [[ -d /home/akanealw ]] if [[ -d /home/akanealw ]]
then
isInFile=$(cat /etc/shadow | grep -c 'root:!')
if [ $isInFile -eq 0 ]
then then
passwd -l root passwd -l root
skill -KILL -u root skill -KILL -u root
else
"root account already disabled."
fi
else else
echo "akanealw account not found, not locking root." echo "akanealw account not found, not locking root."
fi fi