ခဏလေး ဒီလိုပဲ စဉ်းစားကြည့်
Server hardening ဆိုတာ default setting တွေကို secure configuration အဖြစ် ပြောင်းလဲခြင်းပါ — attack surface (attacker ဝင်နိုင်တဲ့ ဝင်ပေါက်) ကို လျှော့ချတာပါ။ Key hardening step များ — SSH password authentication ကို disable လုပ်ပြီး key-only authentication ဖြင့် ပြောင်း, root login ကို SSH ကနေ disable, unused service/port ကို ပိတ်, fail2ban သုံးပြီး repeated login failure ရှိရင် IP ကို ban, security update ကို automatic install ဖြစ်အောင် setup လုပ်ခြင်း။
လက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်
SSH config ဖိုင် (/etc/ssh/sshd_config) ထဲမှာ PasswordAuthentication no, PermitRootLogin no ဆိုတဲ့ setting ကို ဖွင့်ရင် brute-force password attack risk ကို လုံးဝ ဖယ်ရှားနိုင်ပါတယ် (key-based auth ကိုပဲ ခွင့်ပြု)။ fail2ban ကို install ပြီး SSH jail ကို enable ရင် login failure ၅ ကြိမ်ဆက်တိုက်ရရင် IP address ကို minute ၁၀ လောက် အလိုအလျောက် ban ပေးနိုင်ပါတယ်။
အတူတူ ကြည့်မယ်
# /etc/ssh/sshd_config
PasswordAuthentication no
PermitRootLogin no
# Restart SSH service to apply
sudo systemctl restart sshd
# Install fail2ban
sudo apt install fail2ban
sudo systemctl enable fail2ban --nowSSH hardening config ၂ ခု (password auth disable, root login disable) ကို ဖော်ပြပြီး fail2ban ရဲ့ အလုပ်ကို ရှင်းပြနိုင်မည်။၅ မိနစ် စမ်းကြည့်
Linux tutorial ရဲ့ SSH/Firewall lesson ကို ပြန်ကြည့်ပြီး ဒီ hardening checklist ထဲက item ၃ ခုကို VM/WSL ပေါ်မှာ practice run ကြည့်ပါ (root/production server ပေါ်မှာ မလုပ်ပါနှင့်)။
သတိလေးတစ်ချက်
SSH config ပြောင်းလိုက်ပြီးရင် existing connection ကို မပိတ်ခင် terminal အသစ်တစ်ခုနဲ့ login ပြန်စမ်းကြည့်ပါ — config မှားရင် server ကနေ locked out ဖြစ်နိုင်ပါတယ်။