Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- array_users=($(cat /etc/passwd | cut -d ":" -f 1))
- shell_check() {
- local user=$1
- local shell=$(getent passwd $user | cut -d ":" -f 7)
- if echo $shell | grep sh > /dev/null; then
- echo -e "\033[1;31mWARNING\033[0m: special user '$user' has shell $shell"
- fi
- }
- for user in ${array_users[@]}; do
- #echo $user:
- #id $user
- uuid=$(getent passwd $user | cut -d ":" -f 3)
- #echo $uuid
- # true true = true
- if [ $uuid -lt 1000 ] && [ $uuid -gt 0 ]; then
- shell_check $user
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment