OpenBSD /etc/security PDF Print E-mail
User Rating: / 0
PoorBest 
Written by Bart Dorlandt   
Sunday, 10 June 2007 16:02

Below you'll find the normal piece of the security file. Linenumber 424 - 433

I've editted this because of the mailserver setup I use. This is described here: Mailserver. This way I only get an insecurity mail if the user changed from vmail to something different.

# Mailboxes should be owned by user and unreadable.
ls -l /var/mail | sed 1d | \
awk '$3 != $9 \
{ print "user " $9 " mailbox is owned by " $3 }
$1 != "-rw-------" \
{ print "user " $9 " mailbox is " $1 ", group " $4 }' > $OUTPUT
if [ "$OUTPUT" != "vmail vmail" ]; then
echo "\nChecking mailbox ownership."
cat $OUTPUT
fi

# Mailboxes should be owned by user and unreadable.
ls -l /var/mail | sed 1d | \
awk '$3 != $9 \
{ print "user " $9 " mailbox is owned by " $3 }
$1 != "-rw-------" \
{ print "user " $9 " mailbox is " $1 ", group " $4 }' > $OUTPUT
TEST=`cat $OUTPUT | cut -d" " -f7 | fmt`
if [ "$TEST" != "vmail vmail" ]; then
if [ -s $OUTPUT ] ; then
echo "\nChecking mailbox ownership."
cat $OUTPUT
fi
fi

Last Updated on Friday, 13 February 2009 15:37
 


Related items: