Custom Search

Setting up a secure Linux server - Establishing File Ownership


#!/usr/bin/perl -w
#
# usage:
# perl p-allusers.pl
# this will find all files owned by all users
# and save the data to a file named for each user
# this will generate approx. 1.5 megabytes of files in the
# current working directory, named after the user names
# in /etc/passwd
# written March 2001 by kevin krkosska
#
# this makes the list of users
`cat /etc/passwd |cut -d ":" -f 1 > p1.tmp`;


open (FILE,'p1.tmp') || die "Can't open p1.tmp";
@lusers = <FILE>;
close FILE;
foreach $lusers(@lusers){
chomp ($lusers);

`find / -user $lusers > $lusers`;

next ;
}





www.fiveanddime.net








Custom Search