BM: Baca dalam Bahasa Melayu
World L3: Phone Lines
Firewalls: ufw and nftables
You will learn: how a firewall guards the door, and how to open one port safely.
Checked with Linux (Debian 13) on 1 Nov 2026
The problem
You are you in /home/you. 0 things here. Services: cron running, ssh running, nginx running.
you@kedai:~$Folder ~
Empty folder
+ 3 hidden (ls -a)
Services
cronrunningstarts at bootsshrunningstarts at bootnginxrunningstarts at boot
Phone lines (network) Address 10.0.0.5
Listening ports
:22sshd:80nginx
This call waited more than two minutes, then gave up. Nobody said no. Nobody said yes. Who stays silent like that?
Watch
A firewall is the guard at the door. ufw is Debian’s easy guard. It keeps everyone out, except the extensions on its list.
Try it
You are on the server over SSH. Turning the guard on first would lock you out! Put the steps in a safe order.
First step at the top. Put these in order. Use the arrows, or drag.
- sudo ufw status verbose
- sudo ufw allow OpenSSH
- sudo ufw allow 80/tcp
- sudo ufw enable
Watch
ufw asks before it starts. Answer y only when SSH is on the list.
Try it
Compare two shops. First closed.kedai.example. Then guarded.kedai.example with --connect-timeout 5, so you wait only 5 seconds.
You are you in /home/you. 0 things here. Services: cron running, ssh running, nginx running.
you@kedai:~$Folder ~
Empty folder
+ 3 hidden (ls -a)
Services
cronrunningstarts at bootsshrunningstarts at bootnginxrunningstarts at boot
Phone lines (network) Address 10.0.0.5
Listening ports
:22sshd:80nginx
Check
Real curl errors. Which rung is each one?
Drag a card into a box. Or tap the card, then tap the box.
Check
Only your office, 198.51.100.7, may use port 3000. Which rule?
Pick one answer.
You did it!
You can now read a firewall’s list and open one port without locking yourself out.
Go deeper (optional)
Under ufw sits nftables, the kernel’s rule list (sudo nft list ruleset). Cloud firewalls sit outside the server: both must allow a port. Careful: ports published by Docker skip ufw’s rules. The ufw outputs here came from a real Debian 13 lab.
Real mission
sudo apt install ufwsudo ufw allow OpenSSHsudo ufw enable && sudo ufw status verbose
0 of 4 steps done · Your ticks are saved.
Bahasa Melayu
Panggilan ini tunggu lebih dua minit, kemudian berputus asa. Tiada siapa kata tidak. Tiada siapa kata ya. Siapa yang diam begitu?
Firewall ialah pengawal di pintu. ufw ialah pengawal mudah Debian. Ia halang semua orang, kecuali sambungan dalam senarainya.
Anda berada di server melalui SSH. Hidupkan pengawal dahulu, dan anda terkunci di luar! Susun langkah dengan selamat.
ufw bertanya sebelum bermula. Jawab y hanya bila SSH ada dalam senarai.
Bandingkan dua kedai. Mula-mula closed.kedai.example. Kemudian guarded.kedai.example dengan --connect-timeout 5, supaya anda tunggu 5 saat sahaja.
Ralat curl sebenar. Setiap satu di anak tangga mana?
Hanya pejabat anda, 198.51.100.7, boleh guna port 3000. Peraturan yang mana?
Kini anda boleh baca senarai firewall dan buka satu port tanpa terkunci di luar.
You finished this before. Practice is always welcome!
Official docs: Debian: ufw(8) · Debian wiki: nftables · Docker: packet filtering and firewalls
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?