Login to your server as root and at the root prompt fire the below command:
[email protected][~]vi /etc/cron.daily/chkrootkit.sh
Insert the following to the new file:
#!/bin/bash
cd /your_installpath/chkrootkit-0.42b/
./chkrootkit | mail -s “Daily chkrootkit from Servername” [email protected]
==========
Note
1. Replace ‘your_installpath’ with the actual path to where you unpacked Chkrootkit.
2. Change ‘Servername’ to the server which you are running.
3. Change ‘[email protected]’ to your actual email address where the script will mail you.
==========
Save the file.
Change the file permissions
[email protected][~]chmod 755 /etc/cron.daily/chkrootkit.sh
Now if you like ,you can run a test report manually in SSH, to see how it looks.
[email protected][~]cd /etc/cron.daily/
[email protected][~]./chkrootkit.sh
You’ll now receive a alert with the report!
Everyday you should receive the alert.
You don’t have to run it manually.