How to configure mail address for CSF notification
To configure mail address for CSF notification
Introduction
ConfigServer Firewall (CSF) is a firewall application suite for Linux servers that helps manage and control network traffic, block suspicious IP addresses, and receive real-time alerts about potential threats.
Installation Steps:
Step 1: Check the OS version by using the below command
root@linuxhelp:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy
Step 2: Check the status of the CSF and IFD service by using the below command
root@linuxhelp:~# systemctl status csf lfd
● csf.service - ConfigServer Firewall & Security - csf
Loaded: loaded (/lib/systemd/system/csf.service; enabled; vendor preset: enabled)
Active: active (exited) since Sun 2023-07-02 05:23:04 IST; 23min ago
Main PID: 5507 (code=exited, status=0/SUCCESS)
CPU: 595ms
Jul 02 05:23:04 linuxhelp systemd[1]: Starting ConfigServer Firewall & Security - csf...
Jul 02 05:23:04 linuxhelp csf[5507]: (restoring iptables) (restoring ip6tables)
Jul 02 05:23:04 linuxhelp systemd[1]: Finished ConfigServer Firewall & Security - csf.
● lfd.service - ConfigServer Firewall & Security - lfd
Loaded: loaded (/lib/systemd/system/lfd.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2023-07-02 05:23:05 IST; 23min ago
Main PID: 5549 (lfd - sleeping)
Tasks: 3 (limit: 4573)
Memory: 298.5M
CPU: 11.293s
CGroup: /system.slice/lfd.service
├─5549 "lfd - sleeping"
├─6026 "lfd - (child) (PT) checking user processes"
└─6187 /usr/sbin/sendmail -f root -t
Jul 02 05:44:09 linuxhelp sendmail[6114]: 3620E9Ef006114: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00>
Jul 02 05:44:09 linuxhelp sendmail[6164]: My unqualified host name (linuxhelp) unknown; sleeping for retry
Jul 02 05:45:09 linuxhelp sendmail[6164]: unable to qualify my own domain name (linuxhelp) -- using short name
Jul 02 05:45:09 linuxhelp sendmail[6164]: 3620F9cW006164: from=root, size=359, class=0, nrcpts=1, msgid=<202307020015.>
Jul 02 05:45:09 linuxhelp sendmail[6164]: 3620F9cW006164: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00>
Jul 02 05:45:09 linuxhelp sendmail[6175]: My unqualified host name (linuxhelp) unknown; sleeping for retry
Jul 02 05:46:09 linuxhelp sendmail[6175]: unable to qualify my own domain name (linuxhelp) -- using short name
Jul 02 05:46:09 linuxhelp sendmail[6175]: 3620G9fD006175: from=root, size=359, class=0, nrcpts=1, msgid=<202307020016.>
Jul 02 05:46:09 linuxhelp sendmail[6175]: 3620G9fD006175: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00>
Jul 02 05:46:09 linuxhelp sendmail[6187]: My unqualified host name (linuxhelp) unknown; sleeping for retry
Step 3: Add the mail id in the following line by using the below command
root@linuxhelp:~# vim /etc/csf/csf.conf
LF_ALERT_TO
Step 4: Restart the CSF and IFD service by using the below command
root@linuxhelp:~# systemctl restart csf lfd
Step 5: If you want to change the process time then search for the following line in the csf.conf file
root@linuxhelp:~# vim /etc/csf/csf.conf
Step 6: Restart the CSF and IFD by using the below command
root@linuxhelp:~# systemctl restart csf lfd
Conclusion:
By this how to configure mail address for CSF notification has come to an end.
Q
What is the command to start CSF?
A
csf -s ( " s " denoted for Start )
Q
Where did the allow location?
A
/etc/csf/csf.allow
Q
What is the command to reload CSF?
A
csf -r ( " r " denoted for reload )
Q
Where did the denied location?
A
/etc/csf/csf.deny
Q
How to configure mail address for CSF notification
A
csf -d