HEX
Server: nginx/1.16.1
System: Linux ecs-04358622 4.19.90-2107.6.0.0100.oe1.bclinux.x86_64 #1 SMP Wed Dec 1 19:59:44 CST 2021 x86_64
User: nginx (994)
PHP: 8.0.0
Disabled: NONE
Upload Files
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