home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
c
/
cops_104.zip
/
cops_104
/
extra_src
/
rhosts_sweeper
< prev
next >
Wrap
Text File
|
1992-03-10
|
558b
|
19 lines
#!/bin/sh
#
# This just searches for rhosts with a + in them... needs to be run
# as root to be effective (to access each user's rhosts file; run on
# your NFS server if applicable), but might be plugged into the rest of
# cops if you run things as root normally...
(ypcat passwd; cat /etc/passwd) | awk -F: '{print $1, $(NF-1)}' |
while read user dir ; do
target="$dir/.rhosts"
if test -s "$target" ; then
grep "+" "$target" > /dev/null
if test "$?" = "0" ; then
echo "Warning! A plus ("+") was found in $user's .rhosts file!"
fi
fi
done