Bash: how to check if there is only one root id and all user UIDs are unique?
问题 i have this bash script here that i'm trying to modify to check if there is only one root id, is it vulnerable and currently, this script only checks if there is a duplicate uid and display the users that shares the same uid. Thanks in advance! :) Bash Script: #!/bin/bash /bin/cat /etc/passwd| /bin/cut -f3 -d":" | /bin/sort -n | /usr/bin/uniq-c | while read x ; do [ -z "${x}" ] && break set -$x if [ $1 -gt1 ]; then users=`/bin/gawk -F: '($3 == n) { print $1 }' n=$2 /etc/passwd| /usr/bin/xargs