Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Dec 2007
    Location
    Australia
    Posts
    4

    Default set up cron for chkrootkit

    hi,
    can have help with crontab to run weekly

  2. #2
    Member kbob's Avatar
    Join Date
    May 2011
    Posts
    17
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: set up cron for chkrootkit

    @Thelunatic

    The necessary cron for weekly run is :

    0 15 * * 0 /root/chkrootkit-weekly.sh
    This will run each Sunday as per instructed, of course you can always change the name of the script if your bash file is elsewhere and it probably is.

    Hope this helps you in any way.
    Installation, configuration and optimization while having fun


    Company Site

  3. #3
    Member
    Join Date
    May 2010
    Posts
    9

    Default Re: set up cron for chkrootkit

    Hi man...

    i create this script.... i still a few hours to make that.. i am not find that in any site (the combination ha)

    you change cron.daily to weekly
    nano /etc/cron.daily/rkhunter.sh

    then in rkhunter.sh put this code:

    #!/bin/bash
    (/usr/local/bin/rkhunter --checkversion
    /usr/local/bin/rkhunter --update
    /usr/local/bin/rkhunter -c -sk
    /usr/local/bin/rkhunter --cronjob --report-warnings-only) | mail -s "Server XXX Weekly Report" support@yourdomain.com


    then run this (change daily for weekly)
    chmod +x /etc/cron.daily/rkhunter.sh

    then make a test (change daily for weekly)

    sh /etc/cron.daily/rkhunter.sh

  4. #4
    Member
    Join Date
    Sep 2009
    Location
    Athens Greece
    Posts
    201

    Default Re: set up cron for chkrootkit

    rkunter has an inderface for cpanel you can set the cron from there.
    The Rkhunter WHM Interface » Scriptmantra

  5. #5
    Member
    Join Date
    Aug 2011
    Posts
    11

    Default Re: set up cron for chkrootkit

    I also tried to setup a cronjob for Chkrootkit-0.49
    When I run it manualy it run okay cd /root/chkrootkit-0.49 ==> ./chkrootkit

    I Made the cronjob in /etc/cron.daily

    #!/bin/bash
    cd /root/chkrootkit-0.49/
    ./chkrootkit | mail -s "chkrootkit Scan." host@myserver.com

    but I become this message
    /etc/cron.daily/chkrootkit.sh:

    /etc/cron.daily/chkrootkit.sh: line 3: mail: command not found

    Is there someone with a answer.

    Tom

  6. #6
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,304
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: set up cron for chkrootkit

    Change to the path for mail instead:

    Code:
    ./chkrootkit | /bin/mail -s "chkrootkit Scan" host@myserver.com
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  7. #7
    Member
    Join Date
    Aug 2011
    Posts
    11

    Default Re: set up cron for chkrootkit

    I changed it to
    Code:
    ./chkrootkit | /bin/mail -s "chkrootkit Scan" host@myserver.com
    but tested with:
    Code:
     sh  /etc/cron.daily/chkrootkit.sh
    gave me
    Code:
    /etc/cron.daily/chkrootkit.sh: line 3: /bin/mail: No such file or directory
    Code:
    # whereis mail
    mail: /etc/mail
    but in the mail directory is only spamassassin

  8. #8
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,304
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: set up cron for chkrootkit

    When I do "whereis mail", I show the following:

    Code:
    root@host [~]# whereis mail
    mail: /bin/mail /etc/mail.rc /etc/mail /usr/lib/mail.tildehelp /usr/lib/mail.help /usr/share/man/man1/mail.1.gz
    Run this command to see the output:

    Code:
    rpm -qa | grep -i mailx
    If you show the rpm, then remove it:

    Code:
    rpm -e --nodeps mailx
    Now, reinstall it:

    Code:
    yum -y install mailx
    After that, check if /bin/mail now exists:

    Code:
    ls -lah /bin/mail
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  9. #9
    Member
    Join Date
    Aug 2011
    Posts
    11

    Default Re: set up cron for chkrootkit

    Quote Originally Posted by cPanelTristan View Post
    When I do "whereis mail", I show the following:

    Run this command to see the output:

    Code:
    rpm -qa | grep -i mailx
    Showed nothing, nothing to remove


    reinstalled it:

    Code:
    yum -y install mailx
    After that, check if /bin/mail now exists:

    Code:
    ls -lah /bin/mail
    shows
    lrwxrwxrwx 1 root root 5 Aug 29 18:48 /bin/mail -> mailx

    whereis mail shows

    Code:
    mail: /bin/mail /etc/mail /etc/mail.rc /usr/share/man/man1/mail.1.gz
    I will look tomorrow if its run these night correct.

    Thanks,
    Tom

  10. #10
    Member
    Join Date
    Aug 2011
    Posts
    11

    Default Re: set up cron for chkrootkit

    It Works perfect

Similar Threads & Tags
Similar threads

  1. rootkithunter, how to set it up as a cron?
    By bls24 in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 07-22-2008, 08:03 AM
  2. Broken Pike on Chkrootkit cron
    By Belaird in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 03-29-2008, 10:20 AM
  3. /bin/sh: /root/chkrootkit-0.46a/chkrootkit: Permission denied
    By jsimon in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 10-05-2006, 02:04 AM
  4. How to set cron job through shell ?
    By billau in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 08-15-2004, 10:22 PM
  5. how to set cron jobs
    By Archon in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 07-13-2004, 01:53 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube