Created
February 6, 2018 18:48
-
-
Save anonymous/b7520dc02d03f26916eff67719fa1b41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Quick script to show all jail users and how they coordinate with main box userlist | |
for uid in $(awk 'FS=":" {print $3}' /usr/jails/*/etc/passwd /etc/passwd | sort -n | uniq); do | |
echo -n "$uid " | |
awk 'FS=":", ORS=" " {if ($3=='$uid') {print "[" $1 "]";}}' /etc/passwd | |
awk 'FS=":", ORS=" " {if ($3=='$uid') {print FILENAME ":" $1;}}' /usr/jails/*/etc/passwd | sed -E 's|/usr/jails/||g' | sed -E 's|/etc/passwd||g' | |
echo "" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment