Chkrootkit Cronjob: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
Zeile 15: Zeile 15:
 
  0 3 * * *    (/usr/sbin/chkrootkit 2>&1 | mail -s "chkrootkit output" technik@xxx.de)
 
  0 3 * * *    (/usr/sbin/chkrootkit 2>&1 | mail -s "chkrootkit output" technik@xxx.de)
 
*Warnungen werden hier an die Email technik@xxx.de geschickt
 
*Warnungen werden hier an die Email technik@xxx.de geschickt
====
+
==Tägliche emails von chkrootkit mit sendmail==
 
*Bearbeite /etc/chkrootkit.conf und füge Folgendes hinzu
 
*Bearbeite /etc/chkrootkit.conf und füge Folgendes hinzu
 
  REPORT_EMAIL="deine@email.com"
 
  REPORT_EMAIL="deine@email.com"
Zeile 21: Zeile 21:
 
*Bearbeite /etc/cron.daily/chkrootkit ersetzte $CHKROOTKIT $RUN_DAILY_OPTS mit
 
*Bearbeite /etc/cron.daily/chkrootkit ersetzte $CHKROOTKIT $RUN_DAILY_OPTS mit
  
 +
<pre>
 
$CHKROOTKIT > $LOG_DIR/chkrootkit.log #Run chkrootkit and save the logfile
 
$CHKROOTKIT > $LOG_DIR/chkrootkit.log #Run chkrootkit and save the logfile
 
(
 
(
Zeile 28: Zeile 29:
 
cat $LOG_DIR/chkrootkit.log #Concat the logfile to the output
 
cat $LOG_DIR/chkrootkit.log #Concat the logfile to the output
 
) | /usr/sbin/sendmail $REPORT_EMAIL #Send out the email!
 
) | /usr/sbin/sendmail $REPORT_EMAIL #Send out the email!
 +
</pre>

Version vom 20. Oktober 2022, 14:55 Uhr

Cronjob

/etc/chkrootkit.conf

sudo vi /etc/chkrootkit.conf
  • Ändern Sie die Zeile von:
RUN_DAILY="false"

zu

RUN_DAILY="true"

Chkrootkit Report per Mail

Manueller Cronjob

0 3 * * *    (/usr/sbin/chkrootkit 2>&1 | mail -s "chkrootkit output" technik@xxx.de)
  • Warnungen werden hier an die Email technik@xxx.de geschickt

Tägliche emails von chkrootkit mit sendmail

  • Bearbeite /etc/chkrootkit.conf und füge Folgendes hinzu
REPORT_EMAIL="deine@email.com"
  • Bearbeite /etc/cron.daily/chkrootkit ersetzte $CHKROOTKIT $RUN_DAILY_OPTS mit
$CHKROOTKIT > $LOG_DIR/chkrootkit.log #Run chkrootkit and save the logfile
(
echo "Subject: [chkrootkit] $(hostname -f) - Daily report" #Create subject line using the hostname
echo "To: $REPORT_EMAIL" #Insert To: delivery email address using the variable defined in chkrootkit.conf
echo ""
cat $LOG_DIR/chkrootkit.log #Concat the logfile to the output
) | /usr/sbin/sendmail $REPORT_EMAIL #Send out the email!