Skip to content

Instantly share code, notes, and snippets.

@mdpuma
Created July 13, 2021 09:59
Show Gist options
  • Save mdpuma/180d125137295bfb7728939774e92e7e to your computer and use it in GitHub Desktop.
Save mdpuma/180d125137295bfb7728939774e92e7e to your computer and use it in GitHub Desktop.
change csf/lfd firewall to cphulk blocking
#!/bin/bash
sed -i '/^LF_PERMBLOCK =/s/1/0/' /etc/csf/csf.conf
sed -i '/^CC_LOOKUPS =/s/CC_LOOKUPS.*/CC_LOOKUPS = "1"/' /etc/csf/csf.conf
sed -i '/^LF_TRIGGER =/s/LF_TRIGGER.*/LF_TRIGGER = "0"/' /etc/csf/csf.conf
sed -i '/^LF_TRIGGER_PERM =/s/LF_TRIGGER_PERM.*/LF_TRIGGER_PERM = "0"/' /etc/csf/csf.conf
sed -i '/^LF_EMAIL_ALERT =/s/LF_EMAIL_ALERT.*/LF_EMAIL_ALERT = "0"/' /etc/csf/csf.conf
sed -i '/^LF_SSHD =/s/LF_SSHD.*/LF_SSHD = "0"/' /etc/csf/csf.conf
sed -i '/^LF_FTPD =/s/LF_FTPD.*/LF_FTPD = "0"/' /etc/csf/csf.conf
sed -i '/^LF_SMTPAUTH =/s/LF_SMTPAUTH.*/LF_SMTPAUTH = "0"/' /etc/csf/csf.conf
sed -i '/^LF_POP3D =/s/LF_POP3D.*/LF_POP3D = "0"/' /etc/csf/csf.conf
sed -i '/^LF_IMAPD =/s/LF_IMAPD.*/LF_IMAPD = "0"/' /etc/csf/csf.conf
sed -i '/^LF_CPANEL =/s/LF_CPANEL.*/LF_CPANEL = "0"/' /etc/csf/csf.conf
systemctl restart lfd
systemctl restart csf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment