#!/bin/sh
# Programm to run weekly to check some important items
# must be run by root
#
# find accounts without password
echo ""
echo "Accounts without password"
echo "-------------------------"
/usr/bin/grep '^[^:]*::' /etc/passwd

# find accounts with UID 0 and/or GID 0
echo ""
echo "Accounts with ID 0"
echo "------------------"
/usr/bin/grep ':00*:' /etc/passwd

# Check Permissions
echo ""
echo "Permissions of important files"
echo "------------------------------"
ls -l /etc/passwd /etc/group /etc/hosts /etc/host.equiv /etc/inetd.conf
echo ""

echo "SUID-files"
echo "-----------"
/usr/bin/find / -perm -4000 -type f -exec ls -l {} \; 
echo ""

echo "SGID-files"
echo "----------"
/usr/bin/find / -perm -2000 -type f -exec ls -l {} \;
echo ""

echo "World-writable files"
echo "--------------------"
/usr/bin/find / -perm -2 \( -type f -o -type d \) -exec ls -l {} \;
echo ""

echo "Files without owner"
echo "-------------------"
/usr/bin/find / -nouser -exec ls -l {} \;
echo ""

echo "/var/adm/sulog:"
echo "---------------"
cat /var/adm/sulog
