| |

Cara Install CSF dan Aktifkan Web UI AlmaLinux 9

ConfigServer & Security Firewall (CSF) semakin populer untuk menjaga keamanan server. Membantu mencegah server Anda dari serangan DDOS. Artikel ini akan membantu Anda untuk installasi dan mengkonfigurasi firewall CSF.

Persiapan

Install package perl yang dibutuhkan csf

# dnf install epel-release -y
# dnf install iptables perl-libwww-perl.noarch perl-LWP-Protocol-https.noarch perl-GDGraph wget tar perl-Math-BigInt perl-File-Copy bind-utils -y

Package yang dibutuhkan CSF UI, repo yang digunakan adalah https://repo.almalinux.org/almalinux/

# dnf install perl-IO-Socket-SSL.noarch perl-Net-SSLeay perl-Net-LibIDN2 perl-IO-Socket-INET6 perl-Socket6 -y

Dapatkan source instalasinya dari lamat website nya configserver.com dan ekstrak.

# wget https://download.configserver.com/csf.tgz
# tar xfz csf.tgz

# cd csf/

Install CSF

Jalankan script install.sh

# sh install.sh
csf

Buka file config

# vi /etc/csf/csf.conf

Ubah setting berikut. dan save

###############################################################################
# SECTION:Initial Settings
###############################################################################
# Testing flag - enables a CRON job that clears iptables incase of
# configuration problems when you start csf. This should be enabled until you
# are sure that the firewall works - i.e. incase you get locked out of your
# server! Then do remember to set it to 0 and restart csf when you're sure
# everything is OK. Stopping csf will remove the line from /etc/crontab
#
# lfd will not start while this is enabled
TESTING = "0"

Restart csf

# csf -r

CSF UI

Buka konfigurasi csf

# vi /etc/csf/csf.conf

Ubah parameter UI ke nilai berikut ini.

UI = "1"

Ubah perameter port, user dan password sesuai kebutuhkan

UI_PORT = "1025"
UI_USER = "admin"
UI_PASS = "cob4cob4"

Jika sudah save.

Tambahkan atau Allow ip yang akan mengakses ke CSF UI

# echo "YOUR_IP_ADDR" >> /etc/csf/ui/ui.allow

restart lfd dan csf

# systemctl restart lfd
# csf -r

Cek apakah port csf UI sudah running di port yang ditentukan port 1025

[root@alma ~]# netstat -ntulp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      843/sshd: /usr/sbin
tcp6       0      0 :::9090                 :::*                    LISTEN      1/systemd
tcp6       0      0 :::22                   :::*                    LISTEN      843/sshd: /usr/sbin
tcp6       0      0 :::1025                 :::*                    LISTEN      28564/lfd UI
udp        0      0 127.0.0.1:323           0.0.0.0:*                           7558/chronyd
udp6       0      0 ::1:323                 :::*                                7558/chronyd

Hasil akhir ketika diakses melalui browser.

Dengan begini akan mempermudah dalam melakukan konfigurasi dan manajemen firewall.

Similar Posts

4.5 2 votes
Article Rating
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments