Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Crear lista de usuarios del sistema
- arr_users=$(cat /etc/passwd | cut -d ":" -f 1)
- for user in ${arr_users[@]};do
- echo ${user}:
- id $user
- uuid=$(getent passwd $user | cut -d ":" -f 3)
- if [ $uuid -lt 1000 ] && getent passwd $user | grep sh > /dev/null;then
- echo -e "\033[1;31mWARNING\033[0m: special user has shell"
- fi
- echo shell: $(getent passwd $user | cut -d ":" -f 7)
- echo "---"
- done
Advertisement