Enable Linux Malware Detect (maldet) Monitoring at System Boot  


Joined: 4 years ago
Posts: 156
27/09/2018 1:37 pm  

Linux Malware Detect (maldet) doesn't register itself as a service. This is going to be a problem if you're using maldet monitoring mode.  Because you'll have to manually start maldet each time your server reboots.

There is a inti script to register maldet as a service. But I never got it working. I gave up without troubleshooting it because I know a easy way to do it. We can simply run the maldet monitoring command at boot using /etc/rc.local file.

So to do this, we'll first create a file to include all the directories we want to monitor.

nano /usr/local/maldetect/monitor_paths

Paste paths to all the directories you want to monitor as a comma separated list in this file. Then open /etc/rc.local file with nano text editor,

nano /etc/rc.local

Now paste following line just before that line that says exit 0,

maldet --monitor /usr/local/maldetect/monitor_paths

Save & close file. Linux Malware Detect (maldet) will now start at every reboot in monitoring mode and monitor the directories specified in monitor_paths file.


Become a vpsfix.com affiliate and earn up to 10% commissions from your referrals


Please Login or Register