File: //opt/BCLinux/bse/secure_set/s16_lockUnUsedUser
#!/bin/sh
#=====================================================================
InsertSection "Lock the unused users..."
if [ $DISABLE_UNUSED_USER -eq 1 ]; then
UnUsed=$UNUSED_USER_VALUE
for i in $UnUsed
do
echo "lock user: ${i}"
#sed -i 's/^'${i}':\*/'${i}':!!/' /etc/shadow
usermod -L -s /bin/false $i
done
Display --indent 2 --text "- Use 'usermod' to lock the unused user, and change the shell..." --result FINISHED --color GREEN
else
Display --indent 2 --text "- Skip lock the unused users, due to config file... " --result SKIPPING --color YELLOW
fi