How can I build a list of domains that have a specific user in the passwd file?
for DOMAINS in $(cat domainlist)
ssh root@$DOMAINS "cat /etc/passwd | grep the_user" >>domain_user
...I know that's not correct. But, what I'm wanting is the result to look something like this:
domain_user file should now contain:
So, the domains are listed in the domainlist file, and the script will build a local domain_user file that will indicate if the user was found on the domain or not.