Parent Category: Tutorials
Hits: 4751

# Installation
cd /usr/ports/net/snort
make install
mkdir -p /etc/snort/rules
cd /usr/local/share/examples/snort
cp *.rules /etc/snort/rules
cp *.conf* /etc/snort

useradd -c "Snort daemon" -s /sbin/nologin -d /nonexistent -g =uid _snort

# Add the log directory.
mkdir -p /var/log/snort
chown _snort._snort /var/log/snort
chmod 700 /var/log/snort

# Edit snort.conf.
# Configure the HOME_NET variable if you care that much.
# Change RULES_PATH to "/etc/snort/rules"

# Start the daemon.
/usr/local/bin/snort -D -d -c /etc/snort/snort.conf -u _snort -g _snort

# Add to /etc/rc.conf.local
echo "snort=YES" >> /etc/rc.conf.local

# add to /etc/rc.local
if [ X"${snort}" == X"YES" -a -x /usr/local/bin/snort ]; then
echo -n " snort"; /usr/local/bin/snort -D -d -c /etc/snort/snort.conf -u _snort -g _snort

# Add to /etc/newsyslog.conf
echo "/var/log/snort/alert    _snort:_snort   640  10    *  *     Z /var/run/" >> /etc/newsyslog.conf

# Snort status reports
# Get snort-stat
# Is there a non-Debian-packaged version of this script?
chmod 750 snort-stat
mv snort-stat /usr/local/sbin

# Patch snort-stat
patch /usr/local/sbin/snort-stat snort-stat-2004.05.26.diff

# If you care this much:
# rm /usr/local/sbin/snort-stat.orig

# Get crontab.
chmod 750
mv /usr/local/sbin

# Add snort-stat cron to root's crontab:
00      6       *       *       *       /bin/sh /usr/local/sbin/

# If want to make sure the snort comes up on a reboot, reboot the machine now.


We use Hosting and VPS Hosting, from:

We like and trust them.

Good prices, high security.