File: //opt/BCLinux/bse/secure_check/c16_lockUnUsedUser
#!/bin/sh
#=======================================================
InsertSection "check the unused user"
UnUsed="adm lp sync shutdown halt news uucp operator games nobody rpm smmsp"
ERROR_USER=""
COUNTER="0"
for i in $UnUsed
do
IS_EXIST=`cat /etc/shadow |grep -i "^${i}" | wc -l`
if [ $IS_EXIST -gt 0 ];then
TMP=`cat /etc/shadow |grep -i "^${i}:\!" | wc -l `
if [ $TMP -eq 0 ];then
ERROR_USER="${ERROR_USER}|"$i
COUNTER=`expr ${COUNTER} + 1`
fi
fi
done
if [ ${COUNTER} -gt 0 ];then
echo "c16" >> $RESULT_FILE
echo "" >> $RESULT_FILE
logtext "WRN_C16: These users:${ERROR_USER} should lock"
logtext "Suggestion: $(loadtext TXT_SUG_C16)"
Display --indent 2 --text "- Check if there have unused user... " --result WARNING --color RED
AddHP 0 1
else
logtext "All unused user is locked, checking ok"
Display --indent 2 --text "- Check if there have unused user... " --result OK --color GREEN
AddHP 1 1
fi