fleet/scripts/mdm/linux/linux-unlock.sh
2023-12-12 14:52:27 -06:00

11 lines
272 B
Bash

#!/bin/sh
# Unlock password for all non-root users
awk -F':' '{ if ($3 >= 1000 && $3 < 60000) print $1 }' /etc/passwd | while read user
do
echo "$user"
if [ "$user" != "root" ]; then
echo "Unlocking password for $user"
passwd -u $user
fi
done