check-rhosts.sh 568B

1234567891011121314151617181920212223
  1. HOSTS="/etc/hosts.equiv"
  2. if [ -f "$HOSTS" ];then
  3. echo "Found hosts.equiv"
  4. exit 1
  5. else
  6. echo "hosts.equiv no found"
  7. fi
  8. if [ -f ~/.rhosts ];then
  9. echo "Found .rhosts in /root"
  10. exit 1
  11. else
  12. echo ".rhosts no found in /root"
  13. fi
  14. for i in $(awk -F':' '{ if ( $3 >= 500 ) print $1 }' /etc/passwd);do
  15. HOMEDIR=`eval "echo ~$i"`
  16. if [ -f "$HOMEDIR/.rhosts" ];then
  17. echo "Found .rhosts in $HOMEDIR"
  18. exit 1
  19. else
  20. echo ".rhosts no found in $HOMEDIR"
  21. fi
  22. done