Tuesday, 24 January 2012

Install RKHunter


Install RKHunter
-----------------------

Step 1: Downloading, Installing and Updating

cd /usr/local/src
wget http://dfn.dl.sourceforge.net/sourceforge/rkhunter/rkhunter-1.3.8.tar.gz
wget http://dfn.dl.sourceforge.net/sourceforge/rkhunter/rkhunter-1.3.8.tar.gz.sha1.txt
sha1sum -c rkhunter-1.3.8.tar.gz.sha1.txt
tar -zxvf rkhunter-1.3.8.tar.gz
cd rkhunter-1.3.8
./installer.sh --layout default --install
/usr/local/bin/rkhunter --update
/usr/local/bin/rkhunter --propupd
rm -Rf /usr/local/src/rkhunter*
cd

Step 2: Adding daily cron job

Step 2.1: Create run-file

nano -w /etc/cron.daily/rkhunter.sh

Step 2.2: Add this text to rkhunter.sh

#!/bin/sh
(
/usr/local/bin/rkhunter --versioncheck
/usr/local/bin/rkhunter --update
/usr/local/bin/rkhunter --cronjob --report-warnings-only
) | /bin/mail -s 'rkhunter Daily Run (PutYourServerNameHere)' your@email.here

REMEMBER TO CHANGE (PutYourServerNameHere) AND your@email.here

Step 2.3: Chmod rkhunter.sh to root only

chmod 700 /etc/cron.daily/rkhunter.sh

No comments:

Post a Comment