{"id":43424,"date":"2026-09-04T14:56:09","date_gmt":"2026-09-04T07:56:09","guid":{"rendered":"https:\/\/interdata.vn\/blog\/?p=43424"},"modified":"2026-09-04T15:15:08","modified_gmt":"2026-09-04T08:15:08","slug":"cai-dat-va-cau-hinh-ufw","status":"publish","type":"post","link":"https:\/\/interdata.vn\/blog\/cai-dat-va-cau-hinh-ufw\/","title":{"rendered":"H\u01b0\u1edbng D\u1eabn C\u00e0i \u0110\u1eb7t V\u00e0 C\u1ea5u H\u00ecnh UFW Tr\u00ean Ubuntu Chi Ti\u1ebft T\u1eeb A-Z"},"content":{"rendered":"<p style=\"text-align: justify;\"><span style=\"font-size: 100%;\"><strong>C\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh UFW<\/strong> l\u00e0 b\u01b0\u1edbc b\u1ea3o m\u1eadt \u0111\u1ea7u ti\u00ean m\u00e0 b\u1ea5t k\u1ef3 ai thu\u00ea VPS ch\u1ea1y Ubuntu \u0111\u1ec1u ph\u1ea3i l\u00e0m nh\u01b0ng c\u0169ng l\u00e0 b\u01b0\u1edbc khi\u1ebfn nhi\u1ec1u ng\u01b0\u1eddi m\u1ea5t tr\u1eafng k\u1ebft n\u1ed1i SSH v\u00ec b\u1eadt firewall m\u00e0 qu\u00ean m\u1edf port. B\u00e0i vi\u1ebft n\u00e0y t\u1eeb <a href=\"https:\/\/interdata.vn\/\">InterData<\/a> h\u01b0\u1edbng d\u1eabn b\u1ea1n t\u1eebng b\u01b0\u1edbc c\u00e0i \u0111\u1eb7t, c\u1ea5u h\u00ecnh UFW an to\u00e0n t\u1eeb c\u01a1 b\u1ea3n \u0111\u1ebfn n\u00e2ng cao, k\u00e8m c\u1ea3nh b\u00e1o r\u1ee7i ro c\u1ee5 th\u1ec3 t\u1ea1i m\u1ed7i b\u01b0\u1edbc quan tr\u1ecdng.<\/span><\/p>\n<div style=\"background-color: #eff6ff; padding: 20px; border: 1.5px solid #BFDBFE; border-radius: 12px; margin-bottom: 40px; box-shadow: 0 8px 20px rgba(37,99,235,0.05);\">\n<p style=\"font-family: 'Be Vietnam Pro', sans-serif; font-weight: bold; font-size: 18px; margin: 0 0 15px; color: #1e3a8a;\">N\u1ed8I DUNG B\u00c0I VI\u1ebeT<\/p>\n<ul style=\"list-style-type: none; padding-left: 0; margin: 0;\">\n<li style=\"margin-bottom: 10px;\"><a style=\"text-decoration: none; color: #2563eb; font-weight: bold;\" href=\"#section1\">1. UFW l\u00e0 g\u00ec? V\u00ec sao VPS c\u1ea7n c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh UFW ngay?<\/a><\/li>\n<li style=\"margin-bottom: 10px;\"><a style=\"text-decoration: none; color: #2563eb; font-weight: bold;\" href=\"#section2\">2. H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t UFW tr\u00ean Ubuntu 20.04 \/ 22.04 \/ 24.04<\/a><\/li>\n<li style=\"margin-bottom: 10px;\"><a style=\"text-decoration: none; color: #2563eb; font-weight: bold;\" href=\"#section3\">3. C\u1ea5u h\u00ecnh UFW c\u01a1 b\u1ea3n t\u1eeb allow SSH \u0111\u1ebfn enable an to\u00e0n<\/a><\/li>\n<li style=\"margin-bottom: 10px;\"><a style=\"text-decoration: none; color: #2563eb; font-weight: bold;\" href=\"#section4\">4. C\u1ea5u h\u00ecnh UFW n\u00e2ng cao: m\u1edf port, ch\u1eb7n IP, rate limiting, logging<\/a><\/li>\n<li style=\"margin-bottom: 10px;\"><a style=\"text-decoration: none; color: #2563eb; font-weight: bold;\" href=\"#section5\">5. B\u1ea3ng cheat sheet l\u1ec7nh UFW ph\u1ed5 bi\u1ebfn<\/a><\/li>\n<li style=\"margin-bottom: 10px;\"><a style=\"text-decoration: none; color: #2563eb; font-weight: bold;\" href=\"#section6\">6. So s\u00e1nh UFW vs iptables vs firewalld: khi n\u00e0o d\u00f9ng c\u00e1i n\u00e0o?<\/a><\/li>\n<li style=\"margin-bottom: 10px;\"><a style=\"text-decoration: none; color: #2563eb; font-weight: bold;\" href=\"#section7\">7. X\u1eed l\u00fd s\u1ef1 c\u1ed1 UFW th\u01b0\u1eddng g\u1eb7p: m\u1ea5t SSH, Docker bypass, reset<\/a><\/li>\n<li style=\"margin-bottom: 10px;\"><a style=\"text-decoration: none; color: #2563eb; font-weight: bold;\" href=\"#section8\">8. K\u1ebft h\u1ee3p UFW v\u1edbi Fail2ban \u0111\u1ec3 b\u1ea3o m\u1eadt SSH to\u00e0n di\u1ec7n<\/a><\/li>\n<li style=\"margin-bottom: 10px;\"><a style=\"text-decoration: none; color: #2563eb; font-weight: bold;\" href=\"#section9\">9. C\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p v\u1ec1 c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh UFW<\/a><\/li>\n<\/ul>\n<\/div>\n\n\n<style>\n.interdata-plan-carousel,.interdata-plan-carousel *{box-sizing:border-box}\n.interdata-plan-carousel{--blue:#005bea;--blue-dark:#004dcc;--text:#071832;--muted:#516173;--border:#d8e6fb;--bg:#f3f8ff;--shadow:0 5px 14px rgba(0,62,145,.08);background:var(--bg);padding:14px 56px 18px;position:relative;overflow:hidden;border-radius:20px;}\n.interdata-carousel-heading{color:#f00;font-family:Roboto,sans-serif;font-size:18px;line-height:1.35;font-weight:800;text-align:center;margin:0 0 14px}\n.interdata-plan-viewport{overflow:hidden;width:100%}\n.interdata-plan-track{display:flex;align-items:stretch;gap:12px;overflow:visible;padding:0 0 4px;transform:translate3d(0,0,0);transition:transform .45s ease;will-change:transform;touch-action:pan-y}\n.interdata-plan-card{flex:0 0 calc((100% - 24px)\/3);min-width:0;min-height:0!important;height:auto;background:#fff;border:1px solid var(--border);border-radius:8px;padding:15px 12px 13px;display:flex;flex-direction:column;box-shadow:var(--shadow)}\n.interdata-plan-title{color:var(--blue-dark);font-size:16px;line-height:1.22;font-weight:800;text-align:center;margin:0 0 7px;text-transform:uppercase;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n.interdata-plan-price{color:var(--blue-dark);font-size:24px;line-height:1;font-weight:900;text-align:center;margin-bottom:12px;white-space:nowrap;letter-spacing:0}\n.interdata-plan-price span{font-size:10px;font-weight:800;margin-left:2px}\n.interdata-plan-badge{align-self:center;display:inline-flex;align-items:center;justify-content:center;background:#ff3934;color:#fff;border-radius:5px;padding:7px 8px;font-size:9px;line-height:1;font-weight:800;margin-bottom:15px;white-space:nowrap;max-width:100%}\n.interdata-plan-features{list-style:none!important;padding:0!important;margin:0!important}\n.interdata-plan-features li{display:flex;gap:7px;align-items:flex-start;color:var(--text);font-size:12px;line-height:1.35;font-weight:700;text-align:left;margin:0 0 10px!important;padding:0!important}\n.interdata-plan-icon{width:14px;min-width:14px;height:14px;color:#0069ff;margin-top:2px}\n.interdata-plan-icon svg{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}\n.interdata-plan-spacer{flex:1;min-height:16px}\n.interdata-plan-button{display:flex;align-items:center;justify-content:center;min-height:42px;width:100%;margin-top:auto!important;margin-bottom:0!important;background:var(--blue);color:#fff!important;border-radius:5px;font-size:13px;font-weight:800;text-decoration:none!important;box-shadow:0 7px 14px rgba(0,91,234,.24);transition:transform .2s ease,background .2s ease}\n.interdata-plan-button:hover{background:var(--blue-dark);color:#fff!important;transform:translateY(-1px)}\n.interdata-carousel-arrow{position:absolute;top:50%;z-index:5;width:44px;height:54px;border:2px solid #fff!important;border-radius:999px;background:var(--blue)!important;color:#fff!important;box-shadow:0 8px 22px rgba(0,62,145,.32);display:flex!important;align-items:center;justify-content:center;cursor:pointer;transform:translateY(-35%);transition:background .2s ease,color .2s ease,opacity .2s ease,transform .2s ease}\n.interdata-carousel-arrow:hover{background:var(--blue-dark)!important;color:#fff!important;transform:translateY(-35%) scale(1.04)}\n.interdata-carousel-arrow:disabled{opacity:.78;cursor:not-allowed;background:#8aa6cf!important;color:#fff!important}\n.interdata-carousel-arrow:disabled:hover{background:#8aa6cf!important;color:#fff!important;transform:translateY(-35%)}\n.interdata-carousel-arrow svg{display:none!important}\n.interdata-carousel-arrow:before{content:none!important;display:none!important}\n.interdata-carousel-mark{display:block!important;color:#fff!important;font-family:Arial,Helvetica,sans-serif!important;font-size:38px!important;font-weight:900!important;line-height:1!important;text-align:center!important;pointer-events:none!important;transform:translateY(-2px)}\n.interdata-carousel-prev{left:14px}\n.interdata-carousel-prev .interdata-carousel-mark{margin-left:-2px}\n.interdata-carousel-next{right:14px}\n.interdata-carousel-next .interdata-carousel-mark{margin-right:-2px}\n@media (max-width:800px){.interdata-plan-carousel{padding:12px 44px 16px}.interdata-plan-card{flex-basis:calc((100% - 12px)\/2)}.interdata-carousel-heading{font-size:16px}.interdata-carousel-prev{left:6px}.interdata-carousel-next{right:6px}}\n@media (max-width:480px){.interdata-plan-carousel{padding:12px 38px 16px}.interdata-plan-card{flex-basis:100%}.interdata-plan-price{font-size:23px}.interdata-carousel-arrow{width:34px;height:44px}.interdata-carousel-mark{font-size:32px!important}.interdata-carousel-prev{left:3px}.interdata-carousel-next{right:3px}}\n<\/style>\n\n<div class=\"interdata-plan-carousel\" data-interdata-carousel>\n  <div class=\"interdata-carousel-heading\">Si\u00eau \u01afu \u0110\u00e3i VPS \/ CLOUD SERVER - Ti\u1ebft Ki\u1ec7m \u0110\u1ebfn 70%<\/div>\n\n  <svg width=\"0\" height=\"0\" style=\"position:absolute;visibility:hidden\" aria-hidden=\"true\">\n    <symbol id=\"id-icon-cpu\" viewBox=\"0 0 24 24\"><rect x=\"7\" y=\"7\" width=\"10\" height=\"10\" rx=\"2\"><\/rect><path d=\"M4 9h3M4 15h3M17 9h3M17 15h3M9 4v3M15 4v3M9 17v3M15 17v3\"><\/path><path d=\"M10 10h4v4h-4z\"><\/path><\/symbol>\n    <symbol id=\"id-icon-ram\" viewBox=\"0 0 24 24\"><rect x=\"4\" y=\"8\" width=\"16\" height=\"8\" rx=\"2\"><\/rect><path d=\"M7 16v2M11 16v2M15 16v2M19 16v2M7 11h1M11 11h1M15 11h1\"><\/path><\/symbol>\n    <symbol id=\"id-icon-storage\" viewBox=\"0 0 24 24\"><rect x=\"6\" y=\"3\" width=\"12\" height=\"18\" rx=\"2\"><\/rect><path d=\"M9 7h6\"><\/path><circle cx=\"12\" cy=\"16\" r=\"1.5\"><\/circle><\/symbol>\n    <symbol id=\"id-icon-network\" viewBox=\"0 0 24 24\"><path d=\"M5 12.5a10 10 0 0 1 14 0\"><\/path><path d=\"M8.5 16a5 5 0 0 1 7 0\"><\/path><path d=\"M12 19h.01\"><\/path><\/symbol>\n    <symbol id=\"id-icon-gift\" viewBox=\"0 0 24 24\"><rect x=\"3\" y=\"8\" width=\"18\" height=\"13\" rx=\"2\"><\/rect><path d=\"M12 8v13M3 12h18\"><\/path><path d=\"M7.5 8C6.1 8 5 6.9 5 5.5S6.1 3 7.5 3C10 3 12 8 12 8\"><\/path><path d=\"M16.5 8C17.9 8 19 6.9 19 5.5S17.9 3 16.5 3C14 3 12 8 12 8\"><\/path><\/symbol>\n  <\/svg>\n\n  <button class=\"interdata-carousel-arrow interdata-carousel-prev\" type=\"button\" aria-label=\"Xem 3 g\u00f3i tr\u01b0\u1edbc\" onclick=\"var r=this.closest('[data-interdata-carousel]');if(!r)return false;var t=r.querySelector('.interdata-plan-track'),c=t?t.querySelectorAll('.interdata-plan-card'):[];if(!t||!c.length)return false;var v=window.matchMedia('(max-width:480px)').matches?1:(window.matchMedia('(max-width:800px)').matches?2:3),m=Math.max(0,c.length-Math.min(v,c.length||1)),s=[],i=0;while(i&lt;m){s.push(i);i+=v}if(!s.length||s[s.length-1]!==m)s.push(m);var p=parseInt(r.getAttribute('data-inline-page')||'0',10);p=(p-1+s.length)%s.length;r.setAttribute('data-inline-page',p);var g=parseFloat(window.getComputedStyle(t).gap)||12,w=c[0].getBoundingClientRect().width;t.style.transition='transform .45s ease';t.style.transform='translate3d('+(-(w+g)*s[p])+'px,0,0)';return false;\">\n    <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M15 18l-6-6 6-6\"><\/path><\/svg>\n    <span class=\"interdata-carousel-mark\" aria-hidden=\"true\">&#8249;<\/span>\n  <\/button>\n\n  <div class=\"interdata-plan-viewport\">\n    <div class=\"interdata-plan-track\">\n      <!-- 7 card d\u1ef1 ph\u00f2ng: JavaScript s\u1ebd \u0111\u1ed3ng b\u1ed9 l\u1ea1i t\u1eeb API portal khi trang t\u1ea3i. -->\n      <article class=\"interdata-plan-card\" data-plan-pid=\"490\">\n        <h3 class=\"interdata-plan-title\">Premium Base<\/h3>\n        <div class=\"interdata-plan-price\">299.000 \u0111<span>\/3 th\u00e1ng<\/span><\/div>\n        <div class=\"interdata-plan-badge\">GIA H\u1ea0N KH\u00d4NG \u0110\u1ed4I GI\u00c1<\/div>\n        <ul class=\"interdata-plan-features\">\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-cpu\"><\/use><\/svg><\/span>2 vCore Intel Xeon Scalable<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-ram\"><\/use><\/svg><\/span>2 GB RAM<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-storage\"><\/use><\/svg><\/span>30 GB SSD NVMe<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-network\"><\/use><\/svg><\/span>1 IPv4 Private<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-network\"><\/use><\/svg><\/span>300Mbps Network Port<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-network\"><\/use><\/svg><\/span>Unlimited Bandwidth<\/li>\n        <\/ul>\n\n        <a class=\"interdata-plan-button\" href=\"https:\/\/support.interdata.vn\/index.php?rp=\/store\/best-value-plans-2026\/best-value-plans-premium-base\" target=\"_blank\" rel=\"noopener\">\u0110\u0103ng k\u00fd ngay<\/a>\n      <\/article>\n\n      <article class=\"interdata-plan-card\" data-plan-pid=\"529\">\n        <h3 class=\"interdata-plan-title\">INTER PLATINUM 1<\/h3>\n        <div class=\"interdata-plan-price\">998.000 \u0111<span>\/n\u0103m<\/span><\/div>\n        <div class=\"interdata-plan-badge\">GIA H\u1ea0N KH\u00d4NG \u0110\u1ed4I GI\u00c1<\/div>\n        <ul class=\"interdata-plan-features\">\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-cpu\"><\/use><\/svg><\/span>2 vCore<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-ram\"><\/use><\/svg><\/span>3 GB RAM<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-storage\"><\/use><\/svg><\/span>30 GB SSD NVMe<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-network\"><\/use><\/svg><\/span>1 IPv4 Private<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-network\"><\/use><\/svg><\/span>300Mbps Network Port<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-network\"><\/use><\/svg><\/span>Unlimited Bandwidth<\/li>\n        <\/ul>\n\n        <a class=\"interdata-plan-button\" href=\"https:\/\/support.interdata.vn\/index.php?rp=\/store\/inter-platinum-series-2026\/inter-platinum-1\" target=\"_blank\" rel=\"noopener\">\u0110\u0103ng k\u00fd ngay<\/a>\n      <\/article>\n\n      <article class=\"interdata-plan-card\" data-plan-pid=\"530\">\n        <h3 class=\"interdata-plan-title\">INTER PLATINUM 2<\/h3>\n        <div class=\"interdata-plan-price\">2.666.000 \u0111<span>\/n\u0103m<\/span><\/div>\n        <div class=\"interdata-plan-badge\">GIA H\u1ea0N KH\u00d4NG \u0110\u1ed4I GI\u00c1<\/div>\n        <ul class=\"interdata-plan-features\">\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-cpu\"><\/use><\/svg><\/span>5 vCore<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-ram\"><\/use><\/svg><\/span>8 GB RAM<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-storage\"><\/use><\/svg><\/span>70 GB SSD NVMe<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-network\"><\/use><\/svg><\/span>1 IPv4 Private<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-network\"><\/use><\/svg><\/span>300Mbps Network Port<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-network\"><\/use><\/svg><\/span>Unlimited Bandwidth<\/li>\n        <\/ul>\n\n        <a class=\"interdata-plan-button\" href=\"https:\/\/support.interdata.vn\/index.php?rp=\/store\/inter-platinum-series-2026\/inter-platinum-2\" target=\"_blank\" rel=\"noopener\">\u0110\u0103ng k\u00fd ngay<\/a>\n      <\/article>\n\n      <article class=\"interdata-plan-card\" data-plan-pid=\"531\">\n        <h3 class=\"interdata-plan-title\">INTER PLATINUM 3<\/h3>\n        <div class=\"interdata-plan-price\">5.888.000 \u0111<span>\/n\u0103m<\/span><\/div>\n        <div class=\"interdata-plan-badge\">GIA H\u1ea0N KH\u00d4NG \u0110\u1ed4I GI\u00c1<\/div>\n        <ul class=\"interdata-plan-features\">\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-cpu\"><\/use><\/svg><\/span>9 vCore<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-ram\"><\/use><\/svg><\/span>16 GB RAM<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-storage\"><\/use><\/svg><\/span>140 GB SSD NVMe<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-network\"><\/use><\/svg><\/span>1 IPv4 Private<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-network\"><\/use><\/svg><\/span>300Mbps Network Port<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-network\"><\/use><\/svg><\/span>Unlimited Bandwidth<\/li>\n        <\/ul>\n\n        <a class=\"interdata-plan-button\" href=\"https:\/\/support.interdata.vn\/index.php?rp=\/store\/inter-platinum-series-2026\/inter-platinum-3\" target=\"_blank\" rel=\"noopener\">\u0110\u0103ng k\u00fd ngay<\/a>\n      <\/article>\n\n      <article class=\"interdata-plan-card\" data-plan-pid=\"521\">\n        <h3 class=\"interdata-plan-title\">BD-Cloud 1<\/h3>\n        <div class=\"interdata-plan-price\">988.000 \u0111<span>\/n\u0103m<\/span><\/div>\n        <div class=\"interdata-plan-badge\">GIA H\u1ea0N KH\u00d4NG \u0110\u1ed4I GI\u00c1<\/div>\n        <ul class=\"interdata-plan-features\">\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-cpu\"><\/use><\/svg><\/span>3 vCore<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-ram\"><\/use><\/svg><\/span>3 GB RAM<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-storage\"><\/use><\/svg><\/span>30 GB SSD NVMe<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-network\"><\/use><\/svg><\/span>1 IPv4 Private<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-network\"><\/use><\/svg><\/span>300Mbps Network Port<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-network\"><\/use><\/svg><\/span>Unlimited Bandwidth<\/li>\n        <\/ul>\n\n        <a class=\"interdata-plan-button\" href=\"https:\/\/support.interdata.vn\/index.php?rp=\/store\/best-plan-real-cloud\/bd-cloud-1\" target=\"_blank\" rel=\"noopener\">\u0110\u0103ng k\u00fd ngay<\/a>\n      <\/article>\n\n      <article class=\"interdata-plan-card\" data-plan-pid=\"522\">\n        <h3 class=\"interdata-plan-title\">BD-Cloud 2<\/h3>\n        <div class=\"interdata-plan-price\">2.988.000 \u0111<span>\/n\u0103m<\/span><\/div>\n        <div class=\"interdata-plan-badge\">GIA H\u1ea0N KH\u00d4NG \u0110\u1ed4I GI\u00c1<\/div>\n        <ul class=\"interdata-plan-features\">\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-cpu\"><\/use><\/svg><\/span>4 vCore<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-ram\"><\/use><\/svg><\/span>8 GB RAM<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-storage\"><\/use><\/svg><\/span>80 GB SSD NVMe<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-network\"><\/use><\/svg><\/span>1 IPv4 Private<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-network\"><\/use><\/svg><\/span>300 Mbps Network Port<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-network\"><\/use><\/svg><\/span>Unlimited Bandwidth<\/li>\n        <\/ul>\n\n        <a class=\"interdata-plan-button\" href=\"https:\/\/support.interdata.vn\/index.php?rp=\/store\/best-plan-real-cloud\/bd-cloud-2\" target=\"_blank\" rel=\"noopener\">\u0110\u0103ng k\u00fd ngay<\/a>\n      <\/article>\n\n      <article class=\"interdata-plan-card\" data-plan-pid=\"523\">\n        <h3 class=\"interdata-plan-title\">BD-Cloud 3<\/h3>\n        <div class=\"interdata-plan-price\">5.999.000 \u0111<span>\/n\u0103m<\/span><\/div>\n        <div class=\"interdata-plan-badge\">GIA H\u1ea0N KH\u00d4NG \u0110\u1ed4I GI\u00c1<\/div>\n        <ul class=\"interdata-plan-features\">\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-cpu\"><\/use><\/svg><\/span>8 vCore<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-ram\"><\/use><\/svg><\/span>16 GB RAM<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-storage\"><\/use><\/svg><\/span>140 GB SSD NVMe<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-network\"><\/use><\/svg><\/span>1 IPv4 Private<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-network\"><\/use><\/svg><\/span>400 Mbps Network Port<\/li>\n          <li><span class=\"interdata-plan-icon\"><svg><use href=\"#id-icon-network\"><\/use><\/svg><\/span>Unlimited Bandwidth<\/li>\n        <\/ul>\n\n        <a class=\"interdata-plan-button\" href=\"https:\/\/support.interdata.vn\/index.php?rp=\/store\/best-plan-real-cloud\/bd-cloud-3\" target=\"_blank\" rel=\"noopener\">\u0110\u0103ng k\u00fd ngay<\/a>\n      <\/article>\n    <\/div>\n  <\/div>\n\n  <button class=\"interdata-carousel-arrow interdata-carousel-next\" type=\"button\" aria-label=\"Xem 3 g\u00f3i ti\u1ebfp theo\" onclick=\"var r=this.closest('[data-interdata-carousel]');if(!r)return false;var t=r.querySelector('.interdata-plan-track'),c=t?t.querySelectorAll('.interdata-plan-card'):[];if(!t||!c.length)return false;var v=window.matchMedia('(max-width:480px)').matches?1:(window.matchMedia('(max-width:800px)').matches?2:3),m=Math.max(0,c.length-Math.min(v,c.length||1)),s=[],i=0;while(i&lt;m){s.push(i);i+=v}if(!s.length||s[s.length-1]!==m)s.push(m);var p=parseInt(r.getAttribute('data-inline-page')||'0',10);p=(p+1)%s.length;r.setAttribute('data-inline-page',p);var g=parseFloat(window.getComputedStyle(t).gap)||12,w=c[0].getBoundingClientRect().width;t.style.transition='transform .45s ease';t.style.transform='translate3d('+(-(w+g)*s[p])+'px,0,0)';return false;\">\n    <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M9 18l6-6-6-6\"><\/path><\/svg>\n    <span class=\"interdata-carousel-mark\" aria-hidden=\"true\">&#8250;<\/span>\n  <\/button>\n<\/div>\n\n<script>\n(function(){\n  var API_GROUPS=[\n    {url:'https:\/\/support.interdata.vn\/packages.php?gid=89&module',pids:[490]},\n    {url:'https:\/\/support.interdata.vn\/packages.php?gid=100&module',pids:[529,530,531]},\n    {url:'https:\/\/support.interdata.vn\/packages.php?gid=97&module',pids:[521,522,523]}\n  ];\n  var PLAN_CYCLES={\n    490:{key:'quarterly',label:'3 th\u00e1ng'},\n    529:{key:'annually',label:'n\u0103m'},\n    530:{key:'annually',label:'n\u0103m'},\n    531:{key:'annually',label:'n\u0103m'},\n    521:{key:'annually',label:'n\u0103m'},\n    522:{key:'annually',label:'n\u0103m'},\n    523:{key:'annually',label:'n\u0103m'}\n  };\n\n  function fetchPlanData(){\n    if(window.interdataPlanApiPromise)return window.interdataPlanApiPromise;\n\n    window.interdataPlanApiPromise=Promise.all(API_GROUPS.map(function(group){\n      return fetch(group.url,{method:'GET',mode:'cors',cache:'no-store'})\n        .then(function(response){\n          if(!response.ok)throw new Error('API '+response.status);\n          return response.json();\n        })\n        .then(function(data){\n          if(!data||data.success!==true||!Array.isArray(data.products))return [];\n          return data.products.filter(function(product){\n            return group.pids.indexOf(Number(product.pid))!==-1;\n          });\n        })\n        .catch(function(error){\n          console.warn('Kh\u00f4ng th\u1ec3 c\u1eadp nh\u1eadt nh\u00f3m g\u00f3i InterData:',group.url,error);\n          return [];\n        });\n    })).then(function(groups){\n      return groups.reduce(function(all,products){return all.concat(products);},[]);\n    });\n\n    return window.interdataPlanApiPromise;\n  }\n\n  function parseDescription(html){\n    var source=String(html||'')\n      .replace(\/<brs*\/?>\/gi,'n')\n      .replace(\/<\/(p|div|li)>\/gi,'n');\n    var holder=document.createElement('div');\n    holder.innerHTML=source;\n    var strong=holder.querySelector('strong');\n    var badge=strong?strong.textContent.trim():'';\n    var lines=(holder.textContent||'').split(\/r?n\/).map(function(line){\n      return line.trim();\n    }).filter(Boolean);\n    if(badge&&lines[0]===badge)lines.shift();\n    return {badge:badge,features:lines};\n  }\n\n  function iconForFeature(feature){\n    if(\/ram\/i.test(feature))return 'id-icon-ram';\n    if(\/ssd|nvme|storage|disk\/i.test(feature))return 'id-icon-storage';\n    if(\/vcore|vcpu|cpu|xeon|amd\/i.test(feature))return 'id-icon-cpu';\n    if(\/ipv4|network|mbps|gbps|bandwidth\/i.test(feature))return 'id-icon-network';\n    return 'id-icon-gift';\n  }\n\n  function createFeatureItem(feature){\n    var item=document.createElement('li');\n    var icon=document.createElement('span');\n    var svg=document.createElementNS('http:\/\/www.w3.org\/2000\/svg','svg');\n    var use=document.createElementNS('http:\/\/www.w3.org\/2000\/svg','use');\n    icon.className='interdata-plan-icon';\n    use.setAttribute('href','#'+iconForFeature(feature));\n    svg.appendChild(use);\n    icon.appendChild(svg);\n    item.appendChild(icon);\n    item.appendChild(document.createTextNode(feature));\n    return item;\n  }\n\n  function updateCardFromApi(root,product){\n    var pid=Number(product.pid);\n    var cycle=PLAN_CYCLES[pid];\n    var card=root.querySelector('[data-plan-pid=\"'+pid+'\"]');\n    if(!card||!cycle)return;\n\n    var title=card.querySelector('.interdata-plan-title');\n    var priceBox=card.querySelector('.interdata-plan-price');\n    var badgeBox=card.querySelector('.interdata-plan-badge');\n    var featureList=card.querySelector('.interdata-plan-features');\n    var button=card.querySelector('.interdata-plan-button');\n    var description=parseDescription(product.description);\n    var pricing=product.pricing&&product.pricing.VND;\n    var price=pricing?Number(pricing[cycle.key]):-1;\n\n    if(title&&product.name)title.textContent=product.name;\n    if(priceBox&&Number.isFinite(price)&&price>=0){\n      priceBox.textContent=Math.round(price).toLocaleString('vi-VN')+' \u0111';\n      var suffix=document.createElement('span');\n      suffix.textContent='\/'+cycle.label;\n      priceBox.appendChild(suffix);\n    }\n    if(badgeBox&&description.badge)badgeBox.textContent=description.badge;\n    if(featureList&&description.features.length){\n      featureList.textContent='';\n      description.features.forEach(function(feature){\n        featureList.appendChild(createFeatureItem(feature));\n      });\n    }\n    if(button&&product.product_url)button.href=product.product_url;\n  }\n\n  function setupInterDataCarousel(root){\n    var track=root.querySelector('.interdata-plan-track');\n    var prev=root.querySelector('.interdata-carousel-prev');\n    var next=root.querySelector('.interdata-carousel-next');\n    if(!track||!prev||!next||track.dataset.ready==='1')return;\n    track.dataset.ready='1';\n    prev.disabled=false;\n    next.disabled=false;\n    var activePage=0;\n    var touchStartX=null;\n\n    function visibleCards(){\n      if(window.matchMedia&&window.matchMedia('(max-width:480px)').matches)return 1;\n      if(window.matchMedia&&window.matchMedia('(max-width:800px)').matches)return 2;\n      return 3;\n    }\n\n    function pageStarts(){\n      var total=track.querySelectorAll('.interdata-plan-card').length;\n      var visible=Math.min(visibleCards(),total||1);\n      var maxStart=Math.max(0,total-visible);\n      var starts=[];\n      var start=0;\n      while(start<maxStart){\n        starts.push(start);\n        start+=visible;\n      }\n      if(!starts.length||starts[starts.length-1]!==maxStart)starts.push(maxStart);\n      return starts;\n    }\n\n    function renderSlide(animate){\n      var cards=track.querySelectorAll('.interdata-plan-card');\n      var starts=pageStarts();\n      if(!cards.length||!starts.length)return;\n      if(activePage>=starts.length)activePage=starts.length-1;\n      if(activePage<0)activePage=0;\n\n      var cardWidth=cards[0].getBoundingClientRect().width;\n      var trackStyle=window.getComputedStyle?window.getComputedStyle(track):null;\n      var gap=trackStyle?parseFloat(trackStyle.columnGap||trackStyle.gap):12;\n      if(!Number.isFinite(gap))gap=12;\n      if(cardWidth<=0)return;\n\n      track.style.transition=animate?'transform .45s ease':'none';\n      track.style.transform='translate3d('+(-(cardWidth+gap)*starts[activePage])+'px,0,0)';\n      prev.setAttribute('aria-disabled',starts.length>1?'false':'true');\n      next.setAttribute('aria-disabled',starts.length>1?'false':'true');\n    }\n\n    function move(direction){\n      var starts=pageStarts();\n      if(starts.length<=1)return;\n      activePage=parseInt(root.getAttribute('data-inline-page')||activePage,10)||0;\n      activePage=(activePage+direction+starts.length)%starts.length;\n      root.setAttribute('data-inline-page',activePage);\n      renderSlide(true);\n    }\n\n    track.addEventListener('touchstart',function(event){\n      touchStartX=event.touches&&event.touches[0]?event.touches[0].clientX:null;\n    },{passive:true});\n    track.addEventListener('touchend',function(event){\n      if(touchStartX===null)return;\n      var endX=event.changedTouches&&event.changedTouches[0]?event.changedTouches[0].clientX:touchStartX;\n      var distance=endX-touchStartX;\n      touchStartX=null;\n      if(Math.abs(distance)>=40)move(distance<0?1:-1);\n    },{passive:true});\n\n    function resetAfterResize(){\n      activePage=0;\n      root.setAttribute('data-inline-page','0');\n      renderSlide(false);\n    }\n\n    window.addEventListener('resize',resetAfterResize);\n    window.addEventListener('load',resetAfterResize);\n    if('ResizeObserver' in window){\n      var resizeObserver=new ResizeObserver(function(){renderSlide(false);});\n      resizeObserver.observe(root);\n    }\n    window.requestAnimationFrame(function(){renderSlide(false);});\n    window.setTimeout(function(){renderSlide(false);},250);\n    window.setTimeout(function(){renderSlide(false);},1000);\n\n    fetchPlanData().then(function(products){\n      products.forEach(function(product){updateCardFromApi(root,product);});\n      renderSlide(false);\n    });\n  }\n\n  function initInterDataCarousels(){\n    document.querySelectorAll('[data-interdata-carousel]').forEach(setupInterDataCarousel);\n  }\n\n  if(document.readyState==='loading'){\n    document.addEventListener('DOMContentLoaded',initInterDataCarousels);\n  }else{\n    initInterDataCarousels();\n  }\n\n  if('MutationObserver' in window){\n    var initQueued=false;\n    new MutationObserver(function(){\n      if(initQueued)return;\n      initQueued=true;\n      window.requestAnimationFrame(function(){\n        initQueued=false;\n        initInterDataCarousels();\n      });\n    }).observe(document.documentElement,{childList:true,subtree:true});\n  }\n})();\n<\/script>\n\n\t<div id=\"gap-735228314\" class=\"gap-element clearfix\" style=\"display:block; height:auto;\">\n\t\t\n<style>\n#gap-735228314 {\n  padding-top: 15px;\n}\n<\/style>\n\t<\/div>\n\t\n<h2 id=\"section1\" style=\"color: #1e3a8a; font-size: 24px; font-weight: bold; text-align: left; border-left: 5px solid #2563EB; padding-left: 15px; margin: 40px 0 20px; line-height: 1.4;\">UFW l\u00e0 g\u00ec? V\u00ec sao VPS c\u1ea7n c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh UFW ngay?<\/h2>\n<p style=\"text-align: justify;\">UFW (Uncomplicated Firewall) l\u00e0 c\u00f4ng c\u1ee5 qu\u1ea3n l\u00fd <a href=\"https:\/\/interdata.vn\/blog\/tuong-lua-firewall\/\">t\u01b0\u1eddng l\u1eeda (Firewall)<\/a> m\u1eb7c \u0111\u1ecbnh tr\u00ean Ubuntu, ho\u1ea1t \u0111\u1ed9ng nh\u01b0 l\u1edbp giao di\u1ec7n \u0111\u01a1n gi\u1ea3n ph\u00eda tr\u00ean iptables\/netfilter &#8211; b\u1ed9 l\u1ecdc g\u00f3i tin c\u1ea5p kernel c\u1ee7a <a href=\"https:\/\/interdata.vn\/blog\/he-dieu-hanh-linux-la-gi\/\">h\u1ec7 \u0111i\u1ec1u h\u00e0nh Linux<\/a>. Thay v\u00ec vi\u1ebft h\u00e0ng ch\u1ee5c d\u00f2ng l\u1ec7nh iptables ph\u1ee9c t\u1ea1p, b\u1ea1n ch\u1ec9 c\u1ea7n m\u1ed9t l\u1ec7nh UFW ng\u1eafn g\u1ecdn \u0111\u1ec3 m\u1edf port, ch\u1eb7n IP hay thi\u1ebft l\u1eadp ch\u00ednh s\u00e1ch m\u1eb7c \u0111\u1ecbnh.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43430\" src=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/09\/UFW-la-gi.png\" alt=\"UFW l\u00e0 g\u00ec\" width=\"591\" height=\"526\" title=\"\" srcset=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/09\/UFW-la-gi.png 591w, https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/09\/UFW-la-gi-300x267.png 300w\" sizes=\"auto, (max-width: 591px) 100vw, 591px\" \/><\/p>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin: 30px 0 15px;\">VPS m\u1edbi = c\u1eeda m\u1edf toang n\u1ebfu kh\u00f4ng c\u00f3 firewall<\/h3>\n<p style=\"text-align: justify;\">Khi b\u1ea1n thu\u00ea m\u1ed9t <a href=\"https:\/\/interdata.vn\/blog\/vps-la-gi\/\">VPS<\/a> ch\u1ea1y Ubuntu, UFW \u0111\u00e3 \u0111\u01b0\u1ee3c c\u00e0i s\u1eb5n nh\u01b0ng \u1edf tr\u1ea1ng th\u00e1i <strong>inactive<\/strong> (t\u1eaft). \u0110i\u1ec1u n\u00e0y c\u00f3 ngh\u0129a m\u1ecdi port tr\u00ean server \u0111\u1ec1u m\u1edf, m\u1ecdi k\u1ebft n\u1ed1i t\u1eeb Internet \u0111\u1ec1u \u0111\u01b0\u1ee3c ch\u1ea5p nh\u1eadn. Bot qu\u00e9t port t\u1ef1 \u0111\u1ed9ng s\u1ebd t\u00ecm th\u1ea5y VPS c\u1ee7a b\u1ea1n trong v\u00e0i ph\u00fat sau khi kh\u1edfi t\u1ea1o.<\/p>\n<p style=\"text-align: justify;\">\u0110\u00f3 l\u00e0 l\u00fd do c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh UFW c\u1ea7n l\u00e0 vi\u1ec7c \u0111\u1ea7u ti\u00ean b\u1ea1n l\u00e0m sau khi nh\u1eadn VPS &#8211; tr\u01b0\u1edbc c\u1ea3 khi c\u00e0i web server hay deploy \u1ee9ng d\u1ee5ng.<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin: 30px 0 15px;\">UFW ph\u00f9 h\u1ee3p v\u1edbi ai?<\/h3>\n<ul style=\"margin: 15px 0; padding-left: 20px;\">\n<li style=\"margin-bottom: 8px;\">Ng\u01b0\u1eddi m\u1edbi d\u00f9ng VPS l\u1ea7n \u0111\u1ea7u, ch\u01b0a quen iptables.<\/li>\n<li style=\"margin-bottom: 8px;\">Developer, freelancer c\u1ea7n b\u1ea3o m\u1eadt server nhanh m\u00e0 kh\u00f4ng c\u1ea7n h\u1ecdc c\u00fa ph\u00e1p ph\u1ee9c t\u1ea1p.<\/li>\n<li style=\"margin-bottom: 8px;\">Sysadmin qu\u1ea3n tr\u1ecb VPS\/Cloud Server ch\u1ea1y Ubuntu ho\u1eb7c Debian, c\u1ea7n firewall rule r\u00f5 r\u00e0ng, d\u1ec5 audit.<\/li>\n<\/ul>\n<p><!-- BOX CTA #1 - VPS --><\/p>\n<div style=\"display: flex; flex-wrap: wrap; background-color: #fff; border: 1.5px solid #BFDBFE; box-shadow: 0 8px 20px rgba(37,99,235,0.08); border-radius: 12px; overflow: hidden; margin: 35px 0;\">\n<div style=\"flex: 1; min-width: 250px; background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 100%); display: flex; align-items: center; justify-content: center; padding: 30px; text-align: center;\">\n<div>\n<p style=\"color: #fff; font-size: 34px; font-family: 'Be Vietnam Pro', sans-serif; font-weight: bold; margin: 0; line-height: 1.1;\">Thu\u00ea VPS InterData<\/p>\n<p style=\"color: #dbeafe; font-size: 15px; font-weight: 600; margin-top: 12px;\">CPU th\u1ebf h\u1ec7 m\u1edbi \u00b7 SSD NVMe U.2 \u00b7 H\u1ed7 tr\u1ee3 k\u1ef9 thu\u1eadt 24\/7<\/p>\n<\/div>\n<\/div>\n<div style=\"flex: 2; padding: 25px; min-width: 300px;\">\n<p style=\"text-align: justify; font-size: 15px; margin-bottom: 15px;\">\u0110\u1ec3 c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh UFW theo h\u01b0\u1edbng d\u1eabn n\u00e0y, b\u1ea1n c\u1ea7n m\u1ed9t VPS ch\u1ea1y Ubuntu v\u1edbi quy\u1ec1n root \u0111\u1ea7y \u0111\u1ee7. VPS t\u1ea1i InterData cung c\u1ea5p s\u1eb5n m\u00f4i tr\u01b0\u1eddng Ubuntu s\u1ea1ch, quy\u1ec1n root to\u00e0n quy\u1ec1n, v\u00e0 \u0111\u01b0\u1eddng truy\u1ec1n m\u1ea1ng t\u1ed1c \u0111\u1ed9 cao &#8211; s\u1eb5n s\u00e0ng \u0111\u1ec3 b\u1ea1n c\u1ea5u h\u00ecnh firewall ngay sau khi nh\u1eadn server.<\/p>\n<p><a style=\"background: linear-gradient(90deg, #2563EB 0%, #1E3A8A 100%); color: #fff; padding: 12px 25px; text-decoration: none; font-weight: 600; border-radius: 8px; font-size: 15px; display: inline-block; box-shadow: 0 5px 15px rgba(37,99,235,0.3);\" href=\"https:\/\/interdata.vn\/thue-vps\/\" target=\"_blank\" rel=\"noopener\">Xem B\u1ea3ng Gi\u00e1 Thu\u00ea VPS \u27f6<\/a><\/p>\n<\/div>\n<\/div>\n<h2 id=\"section2\" style=\"color: #1e3a8a; font-size: 24px; font-weight: bold; text-align: left; border-left: 5px solid #2563EB; padding-left: 15px; margin: 40px 0 20px; line-height: 1.4;\">H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t UFW tr\u00ean Ubuntu 20.04 \/ 22.04 \/ 24.04<\/h2>\n<p style=\"text-align: justify;\">Tr\u00ean Ubuntu Server 20.04 tr\u1edf l\u00ean, UFW th\u01b0\u1eddng \u0111\u01b0\u1ee3c c\u00e0i s\u1eb5n. B\u01b0\u1edbc \u0111\u1ea7u ti\u00ean l\u00e0 ki\u1ec3m tra xem UFW \u0111\u00e3 c\u00f3 tr\u00ean h\u1ec7 th\u1ed1ng ch\u01b0a, sau \u0111\u00f3 c\u00e0i \u0111\u1eb7t n\u1ebfu thi\u1ebfu.<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin: 30px 0 15px;\">B\u01b0\u1edbc 1: Ki\u1ec3m tra UFW \u0111\u00e3 c\u00e0i ch\u01b0a<\/h3>\n<pre><code>sudo ufw status<\/code><\/pre>\n<p style=\"text-align: justify;\">N\u1ebfu UFW \u0111\u00e3 c\u00e0i, b\u1ea1n s\u1ebd th\u1ea5y d\u00f2ng <code>Status: inactive<\/code> (ch\u01b0a b\u1eadt) ho\u1eb7c <code>Status: active<\/code> (\u0111\u00e3 b\u1eadt). N\u1ebfu h\u1ec7 th\u1ed1ng b\u00e1o <code>ufw: command not found<\/code>, ngh\u0129a l\u00e0 UFW ch\u01b0a \u0111\u01b0\u1ee3c c\u00e0i.<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin: 30px 0 15px;\">B\u01b0\u1edbc 2: C\u00e0i \u0111\u1eb7t UFW n\u1ebfu ch\u01b0a c\u00f3<\/h3>\n<pre><code># C\u1eadp nh\u1eadt danh s\u00e1ch g\u00f3i v\u00e0 c\u00e0i UFW\r\nsudo apt update &amp;&amp; sudo apt install ufw -y<\/code><\/pre>\n<p style=\"text-align: justify;\">Sau khi c\u00e0i xong, ch\u1ea1y l\u1ea1i <code>sudo ufw status<\/code> \u0111\u1ec3 x\u00e1c nh\u1eadn. K\u1ebft qu\u1ea3 <code>Status: inactive<\/code> l\u00e0 \u0111\u00fang &#8211; ch\u01b0a b\u1eadt UFW v\u1ed9i, c\u1ea7n c\u1ea5u h\u00ecnh tr\u01b0\u1edbc.<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin: 30px 0 15px;\">B\u01b0\u1edbc 3: Ki\u1ec3m tra phi\u00ean b\u1ea3n UFW<\/h3>\n<pre><code>sudo ufw version<\/code><\/pre>\n<p style=\"text-align: justify;\">L\u1ec7nh n\u00e0y tr\u1ea3 v\u1ec1 phi\u00ean b\u1ea3n UFW \u0111ang d\u00f9ng (v\u00ed d\u1ee5: <code>ufw 0.36.1<\/code> tr\u00ean Ubuntu 22.04). Bi\u1ebft phi\u00ean b\u1ea3n gi\u00fap b\u1ea1n tra c\u1ee9u \u0111\u00fang t\u00e0i li\u1ec7u khi c\u1ea7n.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43428\" src=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/09\/Kiem-tra-phien-ban-ufw.png\" alt=\"Ki\u1ec3m tra phi\u00ean b\u1ea3n ufw\" width=\"381\" height=\"136\" title=\"\" srcset=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/09\/Kiem-tra-phien-ban-ufw.png 381w, https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/09\/Kiem-tra-phien-ban-ufw-300x107.png 300w\" sizes=\"auto, (max-width: 381px) 100vw, 381px\" \/><\/p>\n<h2 id=\"section3\" style=\"color: #1e3a8a; font-size: 24px; font-weight: bold; text-align: left; border-left: 5px solid #2563EB; padding-left: 15px; margin: 40px 0 20px; line-height: 1.4;\">C\u1ea5u h\u00ecnh UFW c\u01a1 b\u1ea3n t\u1eeb allow SSH \u0111\u1ebfn enable an to\u00e0n<\/h2>\n<p style=\"text-align: justify;\">\u0110\u00e2y l\u00e0 ph\u1ea7n quan tr\u1ecdng nh\u1ea5t khi c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh UFW. Sai th\u1ee9 t\u1ef1 \u1edf \u0111\u00e2y = m\u1ea5t k\u1ebft n\u1ed1i SSH, ph\u1ea3i truy c\u1eadp VNC\/console \u0111\u1ec3 c\u1ee9u server. L\u00e0m \u0111\u00fang th\u1ee9 t\u1ef1 d\u01b0\u1edbi \u0111\u00e2y, b\u1ea1n s\u1ebd kh\u00f4ng g\u1eb7p v\u1ea5n \u0111\u1ec1.<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin: 30px 0 15px;\">B\u01b0\u1edbc 1: Thi\u1ebft l\u1eadp default policy (ch\u00ednh s\u00e1ch m\u1eb7c \u0111\u1ecbnh)<\/h3>\n<p style=\"text-align: justify;\">Nguy\u00ean t\u1eafc b\u1ea3o m\u1eadt c\u01a1 b\u1ea3n: <strong>ch\u1eb7n t\u1ea5t c\u1ea3 k\u1ebft n\u1ed1i \u0111\u1ebfn, cho ph\u00e9p t\u1ea5t c\u1ea3 k\u1ebft n\u1ed1i ra<\/strong>. Sau \u0111\u00f3 m\u1edbi m\u1edf t\u1eebng port c\u1ea7n thi\u1ebft.<\/p>\n<pre><code># Ch\u1eb7n m\u1ecdi k\u1ebft n\u1ed1i \u0111\u1ebfn (incoming) theo m\u1eb7c \u0111\u1ecbnh\r\nsudo ufw default deny incoming\r\n\r\n# Cho ph\u00e9p m\u1ecdi k\u1ebft n\u1ed1i ra (outgoing) theo m\u1eb7c \u0111\u1ecbnh\r\nsudo ufw default allow outgoing<\/code><\/pre>\n<p style=\"text-align: justify;\">Sau khi ch\u1ea1y, terminal s\u1ebd hi\u1ec3n th\u1ecb <code>Default incoming policy changed to 'deny'<\/code> v\u00e0 <code>Default outgoing policy changed to 'allow'<\/code>. Ch\u00ednh s\u00e1ch n\u00e0y ch\u01b0a c\u00f3 hi\u1ec7u l\u1ef1c cho \u0111\u1ebfn khi b\u1ea1n enable UFW.<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin: 30px 0 15px;\">B\u01b0\u1edbc 2: Allow SSH TR\u01af\u1edaC KHI enable UFW<\/h3>\n<div style=\"background-color: #fef2f2; border-left: 4px solid #EF4444; padding: 16px 20px; border-radius: 0 8px 8px 0; margin: 20px 0;\">\n<p style=\"font-weight: bold; color: #991b1b; margin: 0 0 8px;\">\u26a0 C\u1ea3nh b\u00e1o &#8211; \u0111\u00e2y l\u00e0 b\u01b0\u1edbc b\u1eaft bu\u1ed9c<\/p>\n<p style=\"margin: 0; color: #7f1d1d;\">N\u1ebfu b\u1ea1n enable UFW m\u00e0 ch\u01b0a allow SSH, k\u1ebft n\u1ed1i SSH hi\u1ec7n t\u1ea1i s\u1ebd b\u1ecb ng\u1eaft ngay l\u1eadp t\u1ee9c. B\u1ea1n s\u1ebd kh\u00f4ng th\u1ec3 SSH l\u1ea1i v\u00e0o server v\u00e0 ph\u1ea3i truy c\u1eadp qua VNC ho\u1eb7c console t\u1eeb panel nh\u00e0 cung c\u1ea5p \u0111\u1ec3 s\u1eeda. Lu\u00f4n ch\u1ea1y l\u1ec7nh allow SSH tr\u01b0\u1edbc.<\/p>\n<\/div>\n<pre><code># Cho ph\u00e9p SSH (port 22 m\u1eb7c \u0111\u1ecbnh)\r\nsudo ufw allow ssh\r\n\r\n# Ho\u1eb7c n\u1ebfu b\u1ea1n \u0111\u00e3 \u0111\u1ed5i port SSH sang port kh\u00e1c (v\u00ed d\u1ee5 2222):\r\nsudo ufw allow 2222\/tcp<\/code><\/pre>\n<p style=\"text-align: justify;\">L\u1ec7nh <code>sudo ufw allow ssh<\/code> t\u01b0\u01a1ng \u0111\u01b0\u01a1ng <code>sudo ufw allow 22\/tcp<\/code>. N\u1ebfu b\u1ea1n \u0111\u00e3 <a href=\"https:\/\/interdata.vn\/blog\/cach-bao-mat-ssh-vps\/\">thay \u0111\u1ed5i port SSH \u0111\u1ec3 b\u1ea3o m\u1eadt VPS<\/a>, h\u00e3y thay s\u1ed1 port t\u01b0\u01a1ng \u1ee9ng.<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin: 30px 0 15px;\">B\u01b0\u1edbc 3: B\u1eadt UFW (enable)<\/h3>\n<pre><code>sudo ufw enable<\/code><\/pre>\n<p style=\"text-align: justify;\">H\u1ec7 th\u1ed1ng s\u1ebd h\u1ecfi: <code>Command may disrupt existing ssh connections. Proceed with operation (y|n)?<\/code> &#8211; nh\u1eadp <code>y<\/code> v\u00e0 Enter. V\u00ec b\u1ea1n \u0111\u00e3 allow SSH \u1edf b\u01b0\u1edbc tr\u01b0\u1edbc, k\u1ebft n\u1ed1i hi\u1ec7n t\u1ea1i s\u1ebd kh\u00f4ng b\u1ecb ng\u1eaft.<\/p>\n<p style=\"text-align: justify;\">Sau khi enable, UFW t\u1ef1 \u0111\u1ed9ng kh\u1edfi \u0111\u1ed9ng c\u00f9ng h\u1ec7 th\u1ed1ng m\u1ed7i khi reboot. Kh\u00f4ng c\u1ea7n c\u1ea5u h\u00ecnh th\u00eam g\u00ec cho ph\u1ea7n t\u1ef1 kh\u1edfi \u0111\u1ed9ng.<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin: 30px 0 15px;\">B\u01b0\u1edbc 4: M\u1edf port HTTP v\u00e0 HTTPS cho web server<\/h3>\n<p style=\"text-align: justify;\">N\u1ebfu VPS ch\u1ea1y website (Nginx, Apache), b\u1ea1n c\u1ea7n <a href=\"https:\/\/interdata.vn\/blog\/huong-dan-tat-mo-port-tren-vps\/\">m\u1edf port 80 (HTTP) v\u00e0 443 (HTTPS)<\/a>:<\/p>\n<pre><code># M\u1edf port HTTP\r\nsudo ufw allow 80\/tcp\r\n\r\n# M\u1edf port HTTPS\r\nsudo ufw allow 443\/tcp\r\n\r\n# Ho\u1eb7c m\u1edf c\u1ea3 hai c\u00f9ng l\u00fac b\u1eb1ng application profile (n\u1ebfu c\u00f3 Nginx)\r\nsudo ufw allow 'Nginx Full'<\/code><\/pre>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin: 30px 0 15px;\">B\u01b0\u1edbc 5: Ki\u1ec3m tra tr\u1ea1ng th\u00e1i UFW<\/h3>\n<pre><code># Xem tr\u1ea1ng th\u00e1i v\u00e0 danh s\u00e1ch rule \u0111ang \u00e1p d\u1ee5ng\r\nsudo ufw status verbose<\/code><\/pre>\n<p style=\"text-align: justify;\">K\u1ebft qu\u1ea3 s\u1ebd li\u1ec7t k\u00ea: tr\u1ea1ng th\u00e1i (active), default policy, logging level, v\u00e0 t\u1eebng rule \u0111ang \u00e1p d\u1ee5ng v\u1edbi port, giao th\u1ee9c v\u00e0 h\u01b0\u1edbng (IN\/OUT). \u0110\u00e2y l\u00e0 l\u1ec7nh b\u1ea1n s\u1ebd d\u00f9ng th\u01b0\u1eddng xuy\u00ean nh\u1ea5t \u0111\u1ec3 ki\u1ec3m tra c\u1ea5u h\u00ecnh firewall.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43431\" src=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/09\/Kiem-tra-trang-thai-UFW.png\" alt=\"Ki\u1ec3m tra tr\u1ea1ng th\u00e1i UFW\" width=\"577\" height=\"393\" title=\"\" srcset=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/09\/Kiem-tra-trang-thai-UFW.png 577w, https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/09\/Kiem-tra-trang-thai-UFW-300x204.png 300w\" sizes=\"auto, (max-width: 577px) 100vw, 577px\" \/><\/p>\n<p><!-- BOX CTA #2 - CANH ME --><\/p>\n<div style=\"background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%); border: 1.5px solid #2563EB; border-radius: 12px; padding: 28px; margin: 35px 0; text-align: center;\">\n<p style=\"font-family: 'Be Vietnam Pro', sans-serif; font-size: 22px; font-weight: bold; color: #1e3a8a; margin: 0 0 8px;\">S\u0103n Deals VPS &amp; Cloud Server Tr\u01b0\u1edbc Khi Ch\u1ed1t<\/p>\n<p style=\"font-size: 15px; color: #4b5563; margin-bottom: 20px;\">Tr\u01b0\u1edbc khi ch\u1ecdn g\u00f3i VPS ch\u1ea1y Ubuntu \u0111\u1ec3 th\u1ef1c h\u00e0nh c\u1ea5u h\u00ecnh UFW, gh\u00e9 Canh Me \u0111\u1ec3 xem khuy\u1ebfn m\u00e3i, m\u00e3 gi\u1ea3m gi\u00e1 v\u00e0 hot deal m\u1edbi nh\u1ea5t t\u1eeb InterData &#8211; ti\u1ebft ki\u1ec7m chi ph\u00ed ngay t\u1eeb b\u01b0\u1edbc \u0111\u1ea7u.<\/p>\n<p><a style=\"background: #2563EB; color: #fff; padding: 12px 30px; text-decoration: none; font-weight: 600; border-radius: 8px; display: inline-block;\" href=\"https:\/\/interdata.vn\/canhme\/\" target=\"_blank\" rel=\"noopener\">Xem Hot Deals t\u1ea1i Canh Me \u27f6<\/a><\/p>\n<\/div>\n<h2 id=\"section4\" style=\"color: #1e3a8a; font-size: 24px; font-weight: bold; text-align: left; border-left: 5px solid #2563EB; padding-left: 15px; margin: 40px 0 20px; line-height: 1.4;\">C\u1ea5u h\u00ecnh UFW n\u00e2ng cao: M\u1edf port, ch\u1eb7n IP, rate limiting, logging<\/h2>\n<p style=\"text-align: justify;\">Sau khi c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh UFW c\u01a1 b\u1ea3n xong, b\u1ea1n c\u00f3 th\u1ec3 m\u1edf r\u1ed9ng firewall rule cho c\u00e1c t\u00ecnh hu\u1ed1ng c\u1ee5 th\u1ec3. Ph\u1ea7n n\u00e0y d\u00e0nh cho VPS ch\u1ea1y nhi\u1ec1u d\u1ecbch v\u1ee5 ho\u1eb7c c\u1ea7n ki\u1ec3m so\u00e1t truy c\u1eadp ch\u1eb7t h\u01a1n.<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin: 30px 0 15px;\">M\u1edf\/ch\u1eb7n port c\u1ee5 th\u1ec3 (TCP ho\u1eb7c UDP)<\/h3>\n<pre><code># M\u1edf port 3306 (MySQL) ch\u1ec9 cho TCP\r\nsudo ufw allow 3306\/tcp\r\n\r\n# M\u1edf port 53 cho c\u1ea3 TCP v\u00e0 UDP (DNS)\r\nsudo ufw allow 53\r\n\r\n# Ch\u1eb7n port 25 (SMTP) - ng\u0103n server g\u1eedi mail spam\r\nsudo ufw deny 25\/tcp<\/code><\/pre>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin: 30px 0 15px;\">Cho ph\u00e9p truy c\u1eadp t\u1eeb m\u1ed9t IP ho\u1eb7c subnet c\u1ee5 th\u1ec3<\/h3>\n<p style=\"text-align: justify;\">Khi b\u1ea1n mu\u1ed1n ch\u1ec9 cho ph\u00e9p IP v\u0103n ph\u00f2ng ho\u1eb7c IP nh\u00e0 truy c\u1eadp SSH, ho\u1eb7c ch\u1ec9 cho server database n\u1ed9i b\u1ed9 k\u1ebft n\u1ed1i:<\/p>\n<pre><code># Cho ph\u00e9p IP 203.0.113.50 truy c\u1eadp SSH\r\nsudo ufw allow from 203.0.113.50 to any port 22 proto tcp\r\n\r\n# Cho ph\u00e9p subnet 10.0.0.0\/24 truy c\u1eadp MySQL\r\nsudo ufw allow from 10.0.0.0\/24 to any port 3306 proto tcp\r\n\r\n# Ch\u1eb7n to\u00e0n b\u1ed9 k\u1ebft n\u1ed1i t\u1eeb m\u1ed9t IP\r\nsudo ufw deny from 192.168.1.100<\/code><\/pre>\n<div style=\"background-color: #fef2f2; border-left: 4px solid #EF4444; padding: 16px 20px; border-radius: 0 8px 8px 0; margin: 20px 0;\">\n<p style=\"font-weight: bold; color: #991b1b; margin: 0 0 8px;\">\u26a0 L\u01b0u \u00fd khi restrict SSH theo IP<\/p>\n<p style=\"margin: 0; color: #7f1d1d;\">N\u1ebfu b\u1ea1n ch\u1ec9 allow SSH t\u1eeb m\u1ed9t IP c\u1ed1 \u0111\u1ecbnh, h\u00e3y ch\u1eafc ch\u1eafn IP \u0111\u00f3 kh\u00f4ng thay \u0111\u1ed5i (IP t\u0129nh). N\u1ebfu IP nh\u00e0 b\u1ea1n l\u00e0 IP \u0111\u1ed9ng, b\u1ea1n c\u00f3 th\u1ec3 b\u1ecb kh\u00f3a ngo\u00e0i khi ISP \u0111\u1ed5i IP. Lu\u00f4n gi\u1eef quy\u1ec1n truy c\u1eadp VNC\/console d\u1ef1 ph\u00f2ng.<\/p>\n<\/div>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin: 30px 0 15px;\">M\u1edf d\u1ea3i port (port range)<\/h3>\n<pre><code># M\u1edf port t\u1eeb 6000 \u0111\u1ebfn 6100 cho TCP\r\nsudo ufw allow 6000:6100\/tcp\r\n\r\n# M\u1edf port range cho UDP (v\u00ed d\u1ee5: game server, VoIP)\r\nsudo ufw allow 27000:27030\/udp<\/code><\/pre>\n<p style=\"text-align: justify;\">C\u00fa ph\u00e1p d\u00f9ng d\u1ea5u hai ch\u1ea5m <code>:<\/code> gi\u1eefa port b\u1eaft \u0111\u1ea7u v\u00e0 port k\u1ebft th\u00fac. B\u1eaft bu\u1ed9c ch\u1ec9 \u0111\u1ecbnh giao th\u1ee9c (<code>\/tcp<\/code> ho\u1eb7c <code>\/udp<\/code>) khi m\u1edf port range.<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin: 30px 0 15px;\">Xem v\u00e0 d\u00f9ng Application Profile c\u00f3 s\u1eb5n<\/h3>\n<pre><code># Li\u1ec7t k\u00ea c\u00e1c application profile UFW nh\u1eadn bi\u1ebft\r\nsudo ufw app list\r\n\r\n# Xem chi ti\u1ebft profile (v\u00ed d\u1ee5 Nginx Full)\r\nsudo ufw app info 'Nginx Full'\r\n\r\n# Cho ph\u00e9p \u1ee9ng d\u1ee5ng theo t\u00ean profile\r\nsudo ufw allow 'OpenSSH'<\/code><\/pre>\n<p style=\"text-align: justify;\">Application profile l\u00e0 file c\u1ea5u h\u00ecnh trong <code>\/etc\/ufw\/applications.d\/<\/code>, \u0111\u1ecbnh ngh\u0129a s\u1eb5n port cho t\u1eebng \u1ee9ng d\u1ee5ng. Khi c\u00e0i Nginx ho\u1eb7c Apache, profile t\u01b0\u01a1ng \u1ee9ng t\u1ef1 \u0111\u1ed9ng xu\u1ea5t hi\u1ec7n trong danh s\u00e1ch.<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin: 30px 0 15px;\">Rate limiting SSH: ch\u1ed1ng brute-force \u0111\u0103ng nh\u1eadp<\/h3>\n<pre><code># Gi\u1edbi h\u1ea1n t\u1ed1c \u0111\u1ed9 k\u1ebft n\u1ed1i SSH (t\u1ed1i \u0111a 6 k\u1ebft n\u1ed1i\/30 gi\u00e2y t\u1eeb c\u00f9ng IP)\r\nsudo ufw limit ssh<\/code><\/pre>\n<p style=\"text-align: justify;\">L\u1ec7nh <code>ufw limit<\/code> t\u1ef1 \u0111\u1ed9ng ch\u1eb7n t\u1ea1m IP n\u00e0o c\u1ed1 g\u1eafng k\u1ebft n\u1ed1i qu\u00e1 6 l\u1ea7n trong 30 gi\u00e2y. \u0110\u00e2y l\u00e0 bi\u1ec7n ph\u00e1p ch\u1ed1ng brute-force SSH \u0111\u01a1n gi\u1ea3n nh\u1ea5t, n\u1eb1m trong danh s\u00e1ch <a href=\"https:\/\/interdata.vn\/blog\/bao-mat-vps\/\">c\u00e1c c\u00e1ch b\u1ea3o m\u1eadt VPS<\/a> m\u00e0 m\u1ecdi server n\u00ean \u00e1p d\u1ee5ng.<\/p>\n<p style=\"text-align: justify;\">N\u1ebfu b\u1ea1n \u0111\u00e3 c\u00f3 rule <code>allow ssh<\/code> t\u1eeb tr\u01b0\u1edbc, c\u1ea7n x\u00f3a rule c\u0169 r\u1ed3i th\u00eam rule limit:<\/p>\n<pre><code># X\u00f3a rule allow ssh c\u0169\r\nsudo ufw delete allow ssh\r\n\r\n# Thay b\u1eb1ng rule limit\r\nsudo ufw limit ssh<\/code><\/pre>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin: 30px 0 15px;\">B\u1eadt logging \u0111\u1ec3 theo d\u00f5i k\u1ebft n\u1ed1i b\u1ecb ch\u1eb7n<\/h3>\n<pre><code># B\u1eadt logging m\u1ee9c th\u1ea5p (ghi l\u1ea1i c\u00e1c k\u1ebft n\u1ed1i b\u1ecb ch\u1eb7n)\r\nsudo ufw logging on\r\n\r\n# \u0110\u1eb7t m\u1ee9c log chi ti\u1ebft h\u01a1n (low | medium | high | full)\r\nsudo ufw logging medium<\/code><\/pre>\n<p style=\"text-align: justify;\">Log UFW \u0111\u01b0\u1ee3c ghi v\u00e0o <code>\/var\/log\/ufw.log<\/code> (v\u00e0 <code>\/var\/log\/syslog<\/code>). M\u1ee9c <code>low<\/code> ch\u1ec9 ghi k\u1ebft n\u1ed1i b\u1ecb ch\u1eb7n b\u1edfi default policy. M\u1ee9c <code>medium<\/code> ghi th\u00eam c\u00e1c g\u00f3i kh\u00f4ng h\u1ee3p l\u1ec7 v\u00e0 k\u1ebft n\u1ed1i \u0111\u01b0\u1ee3c cho ph\u00e9p. V\u1edbi VPS th\u00f4ng th\u01b0\u1eddng, m\u1ee9c <code>low<\/code> ho\u1eb7c <code>medium<\/code> l\u00e0 \u0111\u1ee7 &#8211; m\u1ee9c <code>high<\/code> v\u00e0 <code>full<\/code> t\u1ea1o r\u1ea5t nhi\u1ec1u log, t\u1ed1n dung l\u01b0\u1ee3ng \u1ed5 \u0111\u0129a.<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin: 30px 0 15px;\">X\u00f3a rule UFW<\/h3>\n<pre><code># C\u00e1ch 1: X\u00f3a rule b\u1eb1ng ch\u00ednh l\u1ec7nh \u0111\u00e3 t\u1ea1o\r\nsudo ufw delete allow 80\/tcp\r\n\r\n# C\u00e1ch 2: X\u00f3a theo s\u1ed1 th\u1ee9 t\u1ef1 rule\r\nsudo ufw status numbered\r\n# K\u1ebft qu\u1ea3 hi\u1ec3n th\u1ecb danh s\u00e1ch rule c\u00f3 \u0111\u00e1nh s\u1ed1 [1], [2], [3]...\r\nsudo ufw delete 3<\/code><\/pre>\n<p style=\"text-align: justify;\">C\u00e1ch 2 ti\u1ec7n h\u01a1n khi rule ph\u1ee9c t\u1ea1p (c\u00f3 IP, subnet). Ch\u1ea1y <code>sudo ufw status numbered<\/code> tr\u01b0\u1edbc \u0111\u1ec3 xem \u0111\u00fang s\u1ed1 rule c\u1ea7n x\u00f3a. H\u1ec7 th\u1ed1ng s\u1ebd h\u1ecfi x\u00e1c nh\u1eadn tr\u01b0\u1edbc khi x\u00f3a.<\/p>\n<h2 id=\"section5\" style=\"color: #1e3a8a; font-size: 24px; font-weight: bold; text-align: left; border-left: 5px solid #2563EB; padding-left: 15px; margin: 40px 0 20px; line-height: 1.4;\">B\u1ea3ng cheat sheet l\u1ec7nh UFW ph\u1ed5 bi\u1ebfn<\/h2>\n<p style=\"text-align: justify;\">B\u1ea3ng t\u1ed5ng h\u1ee3p c\u00e1c l\u1ec7nh UFW d\u00f9ng th\u01b0\u1eddng xuy\u00ean nh\u1ea5t khi c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh UFW tr\u00ean VPS. L\u01b0u l\u1ea1i \u0111\u1ec3 tra nhanh khi c\u1ea7n.<\/p>\n<div style=\"overflow-x: auto;\">\n<table style=\"width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 15px;\">\n<thead>\n<tr style=\"background-color: #1e3a8a; color: #fff;\">\n<th style=\"padding: 12px 15px; text-align: left; border: 1px solid #BFDBFE;\">L\u1ec7nh UFW<\/th>\n<th style=\"padding: 12px 15px; text-align: left; border: 1px solid #BFDBFE;\">Ch\u1ee9c n\u0103ng<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background-color: #f8fafc;\">\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\"><code>sudo ufw enable<\/code><\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\">B\u1eadt UFW (c\u00f3 hi\u1ec7u l\u1ef1c ngay v\u00e0 t\u1ef1 kh\u1edfi \u0111\u1ed9ng c\u00f9ng h\u1ec7 th\u1ed1ng)<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\"><code>sudo ufw disable<\/code><\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\">T\u1eaft UFW (m\u1ecdi rule t\u1ea1m ng\u01b0ng, kh\u00f4ng b\u1ecb x\u00f3a)<\/td>\n<\/tr>\n<tr style=\"background-color: #f8fafc;\">\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\"><code>sudo ufw status verbose<\/code><\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\">Xem tr\u1ea1ng th\u00e1i, default policy v\u00e0 to\u00e0n b\u1ed9 rule \u0111ang \u00e1p d\u1ee5ng<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\"><code>sudo ufw status numbered<\/code><\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\">Li\u1ec7t k\u00ea rule k\u00e8m s\u1ed1 th\u1ee9 t\u1ef1 (d\u00f9ng \u0111\u1ec3 x\u00f3a rule theo s\u1ed1)<\/td>\n<\/tr>\n<tr style=\"background-color: #f8fafc;\">\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\"><code>sudo ufw allow 22\/tcp<\/code><\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\">M\u1edf port 22 cho giao th\u1ee9c TCP (SSH)<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\"><code>sudo ufw deny 3306\/tcp<\/code><\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\">Ch\u1eb7n port 3306 TCP (MySQL) t\u1eeb b\u00ean ngo\u00e0i<\/td>\n<\/tr>\n<tr style=\"background-color: #f8fafc;\">\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\"><code>sudo ufw allow from 10.0.0.0\/24<\/code><\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\">Cho ph\u00e9p to\u00e0n b\u1ed9 k\u1ebft n\u1ed1i t\u1eeb subnet 10.0.0.0\/24<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\"><code>sudo ufw limit ssh<\/code><\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\">Gi\u1edbi h\u1ea1n t\u1ed1c \u0111\u1ed9 k\u1ebft n\u1ed1i SSH (ch\u1ed1ng brute-force)<\/td>\n<\/tr>\n<tr style=\"background-color: #f8fafc;\">\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\"><code>sudo ufw delete allow 80\/tcp<\/code><\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\">X\u00f3a rule cho ph\u00e9p port 80 TCP<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\"><code>sudo ufw delete 3<\/code><\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\">X\u00f3a rule theo s\u1ed1 th\u1ee9 t\u1ef1 (xem b\u1eb1ng status numbered)<\/td>\n<\/tr>\n<tr style=\"background-color: #f8fafc;\">\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\"><code>sudo ufw reset<\/code><\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\">X\u00f3a to\u00e0n b\u1ed9 rule, t\u1eaft UFW, tr\u1edf v\u1ec1 tr\u1ea1ng th\u00e1i ban \u0111\u1ea7u<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\"><code>sudo ufw reload<\/code><\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\">N\u1ea1p l\u1ea1i rule sau khi s\u1eeda file c\u1ea5u h\u00ecnh th\u1ee7 c\u00f4ng<\/td>\n<\/tr>\n<tr style=\"background-color: #f8fafc;\">\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\"><code>sudo ufw logging on<\/code><\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\">B\u1eadt ghi log (m\u1eb7c \u0111\u1ecbnh m\u1ee9c low)<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\"><code>sudo ufw app list<\/code><\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\">Li\u1ec7t k\u00ea application profile c\u00f3 s\u1eb5n<\/td>\n<\/tr>\n<tr style=\"background-color: #f8fafc;\">\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\"><code>sudo ufw allow 6000:6100\/tcp<\/code><\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\">M\u1edf d\u1ea3i port 6000\u20136100 cho TCP<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\"><code>sudo ufw default deny incoming<\/code><\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0;\">\u0110\u1eb7t ch\u00ednh s\u00e1ch m\u1eb7c \u0111\u1ecbnh: ch\u1eb7n m\u1ecdi k\u1ebft n\u1ed1i \u0111\u1ebfn<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2 id=\"section6\" style=\"color: #1e3a8a; font-size: 24px; font-weight: bold; text-align: left; border-left: 5px solid #2563EB; padding-left: 15px; margin: 40px 0 20px; line-height: 1.4;\">So s\u00e1nh UFW vs iptables vs firewalld: khi n\u00e0o d\u00f9ng c\u00e1i n\u00e0o?<\/h2>\n<p style=\"text-align: justify;\">Ba c\u00f4ng c\u1ee5 firewall n\u00e0y \u0111\u1ec1u qu\u1ea3n l\u00fd netfilter (b\u1ed9 l\u1ecdc g\u00f3i tin trong kernel Linux), nh\u01b0ng kh\u00e1c nhau v\u1ec1 c\u00fa ph\u00e1p, \u0111\u1ed9 ph\u1ee9c t\u1ea1p v\u00e0 h\u1ec7 sinh th\u00e1i. B\u1ea3ng d\u01b0\u1edbi \u0111\u00e2y gi\u00fap b\u1ea1n ch\u1ecdn \u0111\u00fang c\u00f4ng c\u1ee5 cho t\u00ecnh hu\u1ed1ng c\u1ee7a m\u00ecnh.<\/p>\n<div style=\"overflow-x: auto;\">\n<table style=\"width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 15px;\">\n<thead>\n<tr style=\"background-color: #1e3a8a; color: #fff;\">\n<th style=\"padding: 12px 15px; text-align: left; border: 1px solid #BFDBFE;\">Ti\u00eau ch\u00ed<\/th>\n<th style=\"padding: 12px 15px; text-align: center; border: 1px solid #BFDBFE;\">UFW<\/th>\n<th style=\"padding: 12px 15px; text-align: center; border: 1px solid #BFDBFE;\">iptables<\/th>\n<th style=\"padding: 12px 15px; text-align: center; border: 1px solid #BFDBFE;\">firewalld<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background-color: #f8fafc;\">\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0; font-weight: 600;\">\u0110\u1ed9 kh\u00f3 s\u1eed d\u1ee5ng<\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0; text-align: center;\">D\u1ec5 &#8211; c\u00fa ph\u00e1p ng\u1eafn, t\u01b0\u1eddng minh<\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0; text-align: center;\">Kh\u00f3 &#8211; c\u00fa ph\u00e1p d\u00e0i, nhi\u1ec1u chain\/table<\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0; text-align: center;\">Trung b\u00ecnh &#8211; d\u00f9ng kh\u00e1i ni\u1ec7m zone<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0; font-weight: 600;\">Distro m\u1eb7c \u0111\u1ecbnh<\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0; text-align: center;\">Ubuntu, Debian<\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0; text-align: center;\">M\u1ecdi distro (c\u1ea5p th\u1ea5p)<\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0; text-align: center;\">CentOS, RHEL, Fedora, AlmaLinux<\/td>\n<\/tr>\n<tr style=\"background-color: #f8fafc;\">\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0; font-weight: 600;\">Qu\u1ea3n l\u00fd rule<\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0; text-align: center;\">T\u1ef1 l\u01b0u v\u00e0 n\u1ea1p l\u1ea1i khi reboot<\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0; text-align: center;\">C\u1ea7n iptables-persistent ho\u1eb7c script<\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0; text-align: center;\">T\u1ef1 l\u01b0u (permanent\/runtime)<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0; font-weight: 600;\">Ph\u00f9 h\u1ee3p cho<\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0; text-align: center;\">VPS c\u00e1 nh\u00e2n, d\u1ef1 \u00e1n nh\u1ecf-v\u1eeba<\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0; text-align: center;\">Server c\u1ea7n rule ph\u1ee9c t\u1ea1p, NAT, mangle<\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0; text-align: center;\">Server RHEL\/CentOS, h\u1ea1 t\u1ea7ng nhi\u1ec1u zone<\/td>\n<\/tr>\n<tr style=\"background-color: #f8fafc;\">\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0; font-weight: 600;\">H\u1ed7 tr\u1ee3 IPv6<\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0; text-align: center;\">C\u00f3 (m\u1eb7c \u0111\u1ecbnh b\u1eadt)<\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0; text-align: center;\">C\u1ea7n ip6tables ri\u00eang<\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0; text-align: center;\">C\u00f3<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0; font-weight: 600;\">Backend<\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0; text-align: center;\">iptables \/ nftables<\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0; text-align: center;\">netfilter tr\u1ef1c ti\u1ebfp<\/td>\n<td style=\"padding: 10px 15px; border: 1px solid #E2E8F0; text-align: center;\">nftables (m\u1edbi) \/ iptables (c\u0169)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p style=\"text-align: justify;\"><strong>K\u1ebft lu\u1eadn:<\/strong> N\u1ebfu b\u1ea1n ch\u1ea1y VPS Ubuntu v\u00e0 c\u1ea7n firewall nhanh, d\u1ec5 qu\u1ea3n l\u00fd &#8211; UFW l\u00e0 l\u1ef1a ch\u1ecdn \u0111\u00fang. Ch\u1ec9 c\u1ea7n chuy\u1ec3n sang iptables tr\u1ef1c ti\u1ebfp khi b\u1ea1n c\u1ea7n rule ph\u1ee9c t\u1ea1p m\u00e0 UFW kh\u00f4ng h\u1ed7 tr\u1ee3 (NAT n\u00e2ng cao, custom chain, packet mangling). Firewalld ph\u00f9 h\u1ee3p h\u01a1n v\u1edbi h\u1ec7 sinh th\u00e1i RHEL\/CentOS.<\/p>\n<h2 id=\"section7\" style=\"color: #1e3a8a; font-size: 24px; font-weight: bold; text-align: left; border-left: 5px solid #2563EB; padding-left: 15px; margin: 40px 0 20px; line-height: 1.4;\">X\u1eed l\u00fd s\u1ef1 c\u1ed1 UFW th\u01b0\u1eddng g\u1eb7p: m\u1ea5t SSH, Docker bypass, reset<\/h2>\n<p style=\"text-align: justify;\">D\u00f9 \u0111\u00e3 c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh UFW c\u1ea9n th\u1eadn, b\u1ea1n v\u1eabn c\u00f3 th\u1ec3 g\u1eb7p c\u00e1c t\u00ecnh hu\u1ed1ng b\u1ea5t ng\u1edd. D\u01b0\u1edbi \u0111\u00e2y l\u00e0 3 s\u1ef1 c\u1ed1 ph\u1ed5 bi\u1ebfn nh\u1ea5t v\u00e0 c\u00e1ch x\u1eed l\u00fd t\u1eebng tr\u01b0\u1eddng h\u1ee3p.<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin: 30px 0 15px;\">S\u1ef1 c\u1ed1 1: M\u1ea5t k\u1ebft n\u1ed1i SSH sau khi b\u1eadt UFW<\/h3>\n<p style=\"text-align: justify;\"><strong>Nguy\u00ean nh\u00e2n:<\/strong> B\u1ea1n ch\u1ea1y <code>sudo ufw enable<\/code> m\u00e0 ch\u01b0a allow SSH tr\u01b0\u1edbc. Default policy <code>deny incoming<\/code> ch\u1eb7n lu\u00f4n port 22.<\/p>\n<p style=\"text-align: justify;\"><strong>C\u00e1ch kh\u1eafc ph\u1ee5c:<\/strong><\/p>\n<ol style=\"margin: 15px 0; padding-left: 20px;\">\n<li style=\"margin-bottom: 10px;\">Truy c\u1eadp server qua <strong>VNC console<\/strong> ho\u1eb7c <strong>Web Console<\/strong> t\u1eeb panel qu\u1ea3n tr\u1ecb VPS c\u1ee7a nh\u00e0 cung c\u1ea5p (InterData h\u1ed7 tr\u1ee3 VNC console trong portal qu\u1ea3n l\u00fd).<\/li>\n<li style=\"margin-bottom: 10px;\">\u0110\u0103ng nh\u1eadp b\u1eb1ng t\u00e0i kho\u1ea3n root ho\u1eb7c user c\u00f3 quy\u1ec1n sudo.<\/li>\n<li style=\"margin-bottom: 10px;\">Ch\u1ea1y c\u00e1c l\u1ec7nh sau:<\/li>\n<\/ol>\n<pre><code># Allow SSH\r\nsudo ufw allow ssh\r\n\r\n# Ki\u1ec3m tra rule \u0111\u00e3 \u0111\u01b0\u1ee3c th\u00eam\r\nsudo ufw status\r\n\r\n# N\u1ebfu c\u1ea7n, reload UFW\r\nsudo ufw reload<\/code><\/pre>\n<p style=\"text-align: justify;\">Sau \u0111\u00f3 th\u1eed SSH l\u1ea1i t\u1eeb m\u00e1y c\u00e1 nh\u00e2n. N\u1ebfu v\u1eabn kh\u00f4ng v\u00e0o \u0111\u01b0\u1ee3c, d\u00f9ng l\u1ec7nh <code>sudo ufw disable<\/code> \u0111\u1ec3 t\u1eaft UFW t\u1ea1m, SSH l\u1ea1i r\u1ed3i c\u1ea5u h\u00ecnh l\u1ea1i t\u1eeb \u0111\u1ea7u.<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin: 30px 0 15px;\">S\u1ef1 c\u1ed1 2: Docker bypass UFW &#8211; port container v\u1eabn m\u1edf d\u00f9 UFW deny<\/h3>\n<p style=\"text-align: justify;\">\u0110\u00e2y l\u00e0 v\u1ea5n \u0111\u1ec1 r\u1ea5t ph\u1ed5 bi\u1ebfn nh\u01b0ng \u00edt b\u00e0i vi\u1ebft ti\u1ebfng Vi\u1ec7t \u0111\u1ec1 c\u1eadp \u0111\u00fang c\u00e1ch. Khi b\u1ea1n ch\u1ea1y <a href=\"https:\/\/interdata.vn\/blog\/docker-la-gi\/\">Docker<\/a> container v\u1edbi flag <code>-p<\/code> (publish port), Docker t\u1ef1 th\u00eam rule v\u00e0o iptables chain <code>DOCKER<\/code> &#8211; <strong>ho\u00e0n to\u00e0n b\u1ecf qua UFW<\/strong>.<\/p>\n<p style=\"text-align: justify;\"><strong>V\u00ed d\u1ee5:<\/strong> B\u1ea1n ch\u1ea1y <code>docker run -p 8080:80 nginx<\/code> r\u1ed3i <code>sudo ufw deny 8080<\/code>. Truy c\u1eadp <code>http:\/\/server-ip:8080<\/code> v\u1eabn th\u1ea5y Nginx. UFW deny kh\u00f4ng c\u00f3 t\u00e1c d\u1ee5ng v\u00ec Docker ghi rule tr\u1ef1c ti\u1ebfp v\u00e0o iptables, tr\u01b0\u1edbc c\u1ea3 chain UFW.<\/p>\n<p style=\"text-align: justify;\"><strong>C\u00e1ch fix:<\/strong><\/p>\n<p style=\"text-align: justify;\">T\u1ea1o ho\u1eb7c ch\u1ec9nh file <code>\/etc\/docker\/daemon.json<\/code> \u0111\u1ec3 Docker kh\u00f4ng t\u1ef1 s\u1eeda iptables:<\/p>\n<pre><code># M\u1edf file c\u1ea5u h\u00ecnh Docker\r\nsudo nano \/etc\/docker\/daemon.json\r\n\r\n# Th\u00eam n\u1ed9i dung sau (ho\u1eb7c merge n\u1ebfu file \u0111\u00e3 c\u00f3 n\u1ed9i dung):\r\n{\r\n  \"iptables\": false\r\n}<\/code><\/pre>\n<div style=\"background-color: #fef2f2; border-left: 4px solid #EF4444; padding: 16px 20px; border-radius: 0 8px 8px 0; margin: 20px 0;\">\n<p style=\"font-weight: bold; color: #991b1b; margin: 0 0 8px;\">\u26a0 C\u1ea3nh b\u00e1o khi t\u1eaft iptables cho Docker<\/p>\n<p style=\"margin: 0; color: #7f1d1d;\">Khi \u0111\u1eb7t <code>\"iptables\": false<\/code>, Docker s\u1ebd kh\u00f4ng t\u1ef1 t\u1ea1o NAT rule n\u1eefa. \u0110i\u1ec1u n\u00e0y c\u00f3 ngh\u0129a container publish port s\u1ebd kh\u00f4ng th\u1ec3 truy c\u1eadp t\u1eeb b\u00ean ngo\u00e0i tr\u1eeb khi b\u1ea1n t\u1ef1 th\u00eam rule UFW cho port \u0111\u00f3. \u0110\u00e2y ch\u00ednh l\u00e0 h\u00e0nh vi mong mu\u1ed1n &#8211; nh\u01b0ng c\u1ea7n test k\u1ef9 tr\u01b0\u1edbc khi \u00e1p d\u1ee5ng tr\u00ean production.<\/p>\n<\/div>\n<pre><code># Restart Docker \u0111\u1ec3 \u00e1p d\u1ee5ng\r\nsudo systemctl restart docker\r\n\r\n# Sau \u0111\u00f3 m\u1edf port cho container qua UFW\r\nsudo ufw allow 8080\/tcp<\/code><\/pre>\n<p style=\"text-align: justify;\"><strong>Ph\u01b0\u01a1ng \u00e1n thay th\u1ebf (kh\u00f4ng t\u1eaft iptables c\u1ee7a Docker):<\/strong> D\u00f9ng flag <code>-p 127.0.0.1:8080:80<\/code> thay v\u00ec <code>-p 8080:80<\/code> \u0111\u1ec3 container ch\u1ec9 listen tr\u00ean localhost, r\u1ed3i d\u00f9ng reverse proxy (Nginx) ph\u00eda tr\u01b0\u1edbc &#8211; UFW s\u1ebd ki\u1ec3m so\u00e1t \u0111\u01b0\u1ee3c port c\u1ee7a Nginx.<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin: 30px 0 15px;\">S\u1ef1 c\u1ed1 3: Reset to\u00e0n b\u1ed9 UFW khi c\u1ea5u h\u00ecnh r\u1ed1i<\/h3>\n<pre><code># Reset UFW v\u1ec1 tr\u1ea1ng th\u00e1i ban \u0111\u1ea7u (x\u00f3a m\u1ecdi rule, t\u1eaft UFW)\r\nsudo ufw reset<\/code><\/pre>\n<p style=\"text-align: justify;\">L\u1ec7nh <code>ufw reset<\/code> s\u1ebd: t\u1eaft UFW, x\u00f3a to\u00e0n b\u1ed9 rule, backup file rule c\u0169 v<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43429\" src=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/09\/Huong-dan-cai-dat-va-cau-hinh-UFW-tren-Ubuntu.jpg\" alt=\"H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh UFW tr\u00ean Ubuntu\" width=\"1050\" height=\"701\" title=\"\" srcset=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/09\/Huong-dan-cai-dat-va-cau-hinh-UFW-tren-Ubuntu.jpg 1050w, https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/09\/Huong-dan-cai-dat-va-cau-hinh-UFW-tren-Ubuntu-300x200.jpg 300w, https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/09\/Huong-dan-cai-dat-va-cau-hinh-UFW-tren-Ubuntu-1024x684.jpg 1024w, https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/09\/Huong-dan-cai-dat-va-cau-hinh-UFW-tren-Ubuntu-768x513.jpg 768w\" sizes=\"auto, (max-width: 1050px) 100vw, 1050px\" \/>\u00e0o <code>\/etc\/ufw\/<\/code> v\u1edbi \u0111u\u00f4i timestamp. Sau khi reset, b\u1ea1n c\u1ea7n c\u1ea5u h\u00ecnh l\u1ea1i t\u1eeb \u0111\u1ea7u: default policy \u2192 allow SSH \u2192 enable.<\/p>\n<div style=\"background-color: #fef2f2; border-left: 4px solid #EF4444; padding: 16px 20px; border-radius: 0 8px 8px 0; margin: 20px 0;\">\n<p style=\"font-weight: bold; color: #991b1b; margin: 0 0 8px;\">\u26a0 Sau khi reset, nh\u1edb allow SSH tr\u01b0\u1edbc khi enable l\u1ea1i<\/p>\n<p style=\"margin: 0; color: #7f1d1d;\">Reset x\u00f3a s\u1ea1ch m\u1ecdi rule, k\u1ec3 c\u1ea3 rule allow SSH. N\u1ebfu b\u1ea1n enable l\u1ea1i m\u00e0 qu\u00ean allow SSH, s\u1ebd l\u1eb7p l\u1ea1i s\u1ef1 c\u1ed1 m\u1ea5t k\u1ebft n\u1ed1i.<\/p>\n<\/div>\n<p><!-- BOX CTA #3 - CLOUD SERVER --><\/p>\n<div style=\"display: flex; flex-wrap: wrap; background-color: #fff; border: 1.5px solid #BFDBFE; box-shadow: 0 8px 20px rgba(37,99,235,0.08); border-radius: 12px; overflow: hidden; margin: 35px 0;\">\n<div style=\"flex: 1; min-width: 250px; background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 100%); display: flex; align-items: center; justify-content: center; padding: 30px; text-align: center;\">\n<div>\n<p style=\"color: #fff; font-size: 34px; font-family: 'Be Vietnam Pro', sans-serif; font-weight: bold; margin: 0; line-height: 1.1;\">Cloud Server InterData<\/p>\n<p style=\"color: #dbeafe; font-size: 15px; font-weight: 600; margin-top: 12px;\">N\u00e2ng\/h\u1ea1 t\u00e0i nguy\u00ean theo t\u1ea3i \u00b7 M\u1ea1ng t\u1ed1c \u0111\u1ed9 cao \u00b7 Ch\u1ed1ng DDoS<\/p>\n<\/div>\n<\/div>\n<div style=\"flex: 2; padding: 25px; min-width: 300px;\">\n<h3 style=\"font-family: 'Be Vietnam Pro', sans-serif; color: #1e3a8a; margin-top: 0; font-size: 20px;\">Server ch\u1ea1y nhi\u1ec1u d\u1ecbch v\u1ee5, c\u1ea7n m\u1edf nhi\u1ec1u port v\u00e0 qu\u1ea3n l\u00fd firewall rule ph\u1ee9c t\u1ea1p?<\/h3>\n<p style=\"text-align: justify; font-size: 15px; margin-bottom: 15px;\">Khi VPS ch\u1ea1y nhi\u1ec1u website, database, Docker container c\u00f9ng l\u00fac &#8211; m\u1ed7i d\u1ecbch v\u1ee5 c\u1ea7n port v\u00e0 rule UFW ri\u00eang &#8211; Cloud Server cho ph\u00e9p b\u1ea1n n\u00e2ng t\u00e0i nguy\u00ean CPU, RAM, SSD m\u00e0 kh\u00f4ng c\u1ea7n migrate d\u1eef li\u1ec7u. Ph\u00f9 h\u1ee3p cho h\u1ea1 t\u1ea7ng \u0111ang m\u1edf r\u1ed9ng, c\u1ea7n qu\u1ea3n tr\u1ecb firewall linh ho\u1ea1t cho nhi\u1ec1u \u1ee9ng d\u1ee5ng tr\u00ean c\u00f9ng server.<\/p>\n<p><a style=\"background: linear-gradient(90deg, #2563EB 0%, #1E3A8A 100%); color: #fff; padding: 12px 25px; text-decoration: none; font-weight: 600; border-radius: 8px; font-size: 15px; display: inline-block; box-shadow: 0 5px 15px rgba(37,99,235,0.3);\" href=\"https:\/\/interdata.vn\/cloud-server\/\" target=\"_blank\" rel=\"noopener\">Xem g\u00f3i Cloud Server \u27f6<\/a><\/p>\n<\/div>\n<\/div>\n<h2 id=\"section8\" style=\"color: #1e3a8a; font-size: 24px; font-weight: bold; text-align: left; border-left: 5px solid #2563EB; padding-left: 15px; margin: 40px 0 20px; line-height: 1.4;\">K\u1ebft h\u1ee3p UFW v\u1edbi Fail2ban \u0111\u1ec3 b\u1ea3o m\u1eadt SSH to\u00e0n di\u1ec7n<\/h2>\n<p style=\"text-align: justify;\">UFW <code>limit<\/code> ch\u1eb7n IP khi c\u00f3 h\u01a1n 6 k\u1ebft n\u1ed1i\/30 gi\u00e2y &#8211; nh\u01b0ng attacker th\u00f4ng minh h\u01a1n th\u1ebf. Ch\u00fang g\u1eedi 3\u20134 l\u1ea7n\/ph\u00fat, \u0111\u1ee7 ch\u1eadm \u0111\u1ec3 v\u01b0\u1ee3t qua rate limit nh\u01b0ng v\u1eabn ch\u1ea1y wordlist c\u1ea3 ng\u00e0y. <a href=\"https:\/\/interdata.vn\/blog\/fail2ban-la-gi\/\">Fail2ban<\/a> gi\u1ea3i quy\u1ebft b\u00e0i to\u00e1n n\u00e0y b\u1eb1ng c\u00e1ch theo d\u00f5i log \u0111\u0103ng nh\u1eadp th\u1ea5t b\u1ea1i v\u00e0 t\u1ef1 \u0111\u1ed9ng th\u00eam rule ban IP v\u00e0o UFW.<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin: 30px 0 15px;\">C\u00e0i \u0111\u1eb7t Fail2ban<\/h3>\n<pre><code># C\u00e0i Fail2ban\r\nsudo apt update &amp;&amp; sudo apt install fail2ban -y\r\n\r\n# Ki\u1ec3m tra tr\u1ea1ng th\u00e1i\r\nsudo systemctl status fail2ban<\/code><\/pre>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin: 30px 0 15px;\">C\u1ea5u h\u00ecnh jail cho SSH s\u1eed d\u1ee5ng UFW l\u00e0m banaction<\/h3>\n<p style=\"text-align: justify;\">T\u1ea1o file c\u1ea5u h\u00ecnh local (kh\u00f4ng s\u1eeda file g\u1ed1c \u0111\u1ec3 tr\u00e1nh b\u1ecb ghi \u0111\u00e8 khi c\u1eadp nh\u1eadt):<\/p>\n<pre><code># T\u1ea1o file c\u1ea5u h\u00ecnh local\r\nsudo cp \/etc\/fail2ban\/jail.conf \/etc\/fail2ban\/jail.local\r\nsudo nano \/etc\/fail2ban\/jail.local<\/code><\/pre>\n<p style=\"text-align: justify;\">T\u00ecm section <code>[sshd]<\/code> v\u00e0 ch\u1ec9nh th\u00e0nh:<\/p>\n<pre><code>[sshd]\r\nenabled = true\r\nport = ssh\r\nfilter = sshd\r\nlogpath = \/var\/log\/auth.log\r\nmaxretry = 5\r\nfindtime = 600\r\nbantime = 3600\r\nbanaction = ufw<\/code><\/pre>\n<p style=\"text-align: justify;\">Gi\u1ea3i th\u00edch c\u1ea5u h\u00ecnh tr\u00ean:<\/p>\n<ul style=\"margin: 15px 0; padding-left: 20px;\">\n<li style=\"margin-bottom: 8px;\"><code>maxretry = 5<\/code> &#8211; ban IP sau 5 l\u1ea7n \u0111\u0103ng nh\u1eadp sai.<\/li>\n<li style=\"margin-bottom: 8px;\"><code>findtime = 600<\/code> &#8211; \u0111\u1ebfm trong khung 10 ph\u00fat (600 gi\u00e2y).<\/li>\n<li style=\"margin-bottom: 8px;\"><code>bantime = 3600<\/code> &#8211; ban 1 gi\u1edd (3600 gi\u00e2y). \u0110\u1eb7t <code>-1<\/code> \u0111\u1ec3 ban v\u0129nh vi\u1ec5n.<\/li>\n<li style=\"margin-bottom: 8px;\"><code>banaction = ufw<\/code> &#8211; d\u00f9ng UFW \u0111\u1ec3 th\u00eam rule ch\u1eb7n IP (thay v\u00ec iptables tr\u1ef1c ti\u1ebfp).<\/li>\n<\/ul>\n<pre><code># Restart Fail2ban \u0111\u1ec3 \u00e1p d\u1ee5ng c\u1ea5u h\u00ecnh m\u1edbi\r\nsudo systemctl restart fail2ban\r\n\r\n# Xem danh s\u00e1ch IP \u0111ang b\u1ecb ban\r\nsudo fail2ban-client status sshd<\/code><\/pre>\n<p style=\"text-align: justify;\">Khi Fail2ban ban m\u1ed9t IP, b\u1ea1n s\u1ebd th\u1ea5y rule m\u1edbi xu\u1ea5t hi\u1ec7n trong <code>sudo ufw status<\/code> &#8211; d\u00f2ng <code>DENY<\/code> v\u1edbi IP b\u1ecb ch\u1eb7n. \u0110\u00e2y l\u00e0 c\u1eb7p \u0111\u00f4i b\u1ea3o m\u1eadt SSH m\u1ea1nh m\u1ebd nh\u1ea5t cho VPS ch\u1ea1y Ubuntu.<\/p>\n<h2 id=\"section9\" style=\"color: #1e3a8a; font-size: 24px; font-weight: bold; text-align: left; border-left: 5px solid #2563EB; padding-left: 15px; margin: 40px 0 20px; line-height: 1.4;\">C\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p v\u1ec1 c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh UFW<\/h2>\n<h3 style=\"color: #1e3a8a; font-size: 18px; font-weight: 600; margin: 25px 0 10px;\">UFW c\u00f3 thay th\u1ebf ho\u00e0n to\u00e0n \u0111\u01b0\u1ee3c iptables kh\u00f4ng?<\/h3>\n<p style=\"text-align: justify;\">UFW l\u00e0 frontend qu\u1ea3n l\u00fd iptables, kh\u00f4ng ph\u1ea3i b\u1ea3n thay th\u1ebf. UFW x\u1eed l\u00fd t\u1ed1t h\u1ea7u h\u1ebft t\u00ecnh hu\u1ed1ng firewall ph\u1ed5 bi\u1ebfn tr\u00ean VPS (allow\/deny port, IP, rate limit). Tuy nhi\u00ean, khi c\u1ea7n NAT ph\u1ee9c t\u1ea1p, custom chain, packet mangling hay quy t\u1eafc match n\u00e2ng cao, b\u1ea1n ph\u1ea3i vi\u1ebft iptables tr\u1ef1c ti\u1ebfp. V\u1edbi VPS ch\u1ea1y website, \u1ee9ng d\u1ee5ng web th\u00f4ng th\u01b0\u1eddng, UFW l\u00e0 \u0111\u1ee7.<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 18px; font-weight: 600; margin: 25px 0 10px;\">UFW c\u00f3 ho\u1ea1t \u0111\u1ed9ng tr\u00ean Debian, Linux Mint kh\u00f4ng?<\/h3>\n<p style=\"text-align: justify;\">C\u00f3. UFW \u0111\u01b0\u1ee3c ph\u00e1t tri\u1ec3n b\u1edfi Canonical cho Ubuntu nh\u01b0ng c\u00f3 s\u1eb5n trong repository c\u1ee7a Debian, Linux Mint v\u00e0 h\u1ea7u h\u1ebft distro d\u1ef1a tr\u00ean Debian. C\u00e0i b\u1eb1ng <code>sudo apt install ufw<\/code>. C\u00fa ph\u00e1p v\u00e0 c\u00e1ch c\u1ea5u h\u00ecnh gi\u1ed1ng h\u1ec7t Ubuntu.<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 18px; font-weight: 600; margin: 25px 0 10px;\">T\u1eaft UFW r\u1ed3i b\u1eadt l\u1ea1i c\u00f3 m\u1ea5t rule kh\u00f4ng?<\/h3>\n<p style=\"text-align: justify;\">Kh\u00f4ng. Khi ch\u1ea1y <code>sudo ufw disable<\/code>, UFW t\u1eaft firewall nh\u01b0ng gi\u1eef nguy\u00ean to\u00e0n b\u1ed9 rule \u0111\u00e3 c\u1ea5u h\u00ecnh. Ch\u1ea1y <code>sudo ufw enable<\/code> l\u1ea1i s\u1ebd n\u1ea1p \u0111\u00fang b\u1ed9 rule c\u0169. Ch\u1ec9 l\u1ec7nh <code>sudo ufw reset<\/code> m\u1edbi x\u00f3a s\u1ea1ch rule (v\u00e0 UFW t\u1ef1 backup file rule tr\u01b0\u1edbc khi x\u00f3a).<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 18px; font-weight: 600; margin: 25px 0 10px;\">L\u00e0m sao bi\u1ebft UFW \u0111ang ch\u1eb7n k\u1ebft n\u1ed1i n\u00e0o?<\/h3>\n<p style=\"text-align: justify;\">B\u1eadt logging b\u1eb1ng <code>sudo ufw logging on<\/code>, sau \u0111\u00f3 ki\u1ec3m tra file <code>\/var\/log\/ufw.log<\/code>. M\u1ed7i d\u00f2ng log ghi r\u00f5: th\u1eddi gian, IP ngu\u1ed3n, IP \u0111\u00edch, port, giao th\u1ee9c v\u00e0 h\u00e0nh \u0111\u1ed9ng (BLOCK ho\u1eb7c ALLOW). D\u00f9ng l\u1ec7nh <code>sudo tail -f \/var\/log\/ufw.log<\/code> \u0111\u1ec3 theo d\u00f5i realtime.<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 18px; font-weight: 600; margin: 25px 0 10px;\">UFW c\u00f3 \u1ea3nh h\u01b0\u1edfng \u0111\u1ebfn t\u1ed1c \u0111\u1ed9 server kh\u00f4ng?<\/h3>\n<p style=\"text-align: justify;\">V\u1edbi s\u1ed1 l\u01b0\u1ee3ng rule th\u00f4ng th\u01b0\u1eddng (d\u01b0\u1edbi 50 rule), UFW h\u1ea7u nh\u01b0 kh\u00f4ng \u1ea3nh h\u01b0\u1edfng \u0111\u1ebfn hi\u1ec7u n\u0103ng. UFW ch\u1ec9 l\u00e0 l\u1edbp giao di\u1ec7n &#8211; x\u1eed l\u00fd th\u1ef1c t\u1ebf do netfilter trong kernel \u0111\u1ea3m nh\u1eadn, r\u1ea5t nhanh. Ch\u1ec9 khi b\u1ea1n c\u00f3 h\u00e0ng tr\u0103m rule ph\u1ee9c t\u1ea1p ho\u1eb7c server x\u1eed l\u00fd h\u00e0ng tri\u1ec7u k\u1ebft n\u1ed1i\/gi\u00e2y th\u00ec m\u1edbi c\u1ea7n t\u1ed1i \u01b0u rule chain.<\/p>\n<div style=\"border-top: 2px dashed #BFDBFE; margin-top: 50px; padding-top: 30px;\">\n<h3 style=\"font-family: 'Be Vietnam Pro', sans-serif; color: #1e3a8a; font-size: 22px; font-weight: bold; margin-bottom: 15px;\">T\u1ed5ng k\u1ebft<\/h3>\n<p style=\"text-align: justify;\">C\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh UFW kh\u00f4ng ph\u1ee9c t\u1ea1p &#8211; nh\u01b0ng sai th\u1ee9 t\u1ef1 th\u00ec tr\u1ea3 gi\u00e1 b\u1eb1ng vi\u1ec7c m\u1ea5t quy\u1ec1n truy c\u1eadp server. Ba nguy\u00ean t\u1eafc c\u1ea7n nh\u1edb: lu\u00f4n allow SSH tr\u01b0\u1edbc khi enable, \u0111\u1eb7t default policy deny incoming tr\u01b0\u1edbc khi m\u1edf port, v\u00e0 test m\u1ecdi thay \u0111\u1ed5i khi c\u00f2n \u0111ang gi\u1eef k\u1ebft n\u1ed1i SSH hi\u1ec7n t\u1ea1i.<\/p>\n<p style=\"text-align: justify;\">N\u1ebfu b\u1ea1n \u0111ang c\u1ea7n m\u1ed9t VPS Ubuntu s\u1ea1ch v\u1edbi quy\u1ec1n root \u0111\u1ec3 th\u1ef1c h\u00e0nh c\u1ea5u h\u00ecnh firewall, ho\u1eb7c c\u1ea7n Cloud Server cho h\u1ea1 t\u1ea7ng nhi\u1ec1u d\u1ecbch v\u1ee5 &#8211; <a href=\"https:\/\/interdata.vn\/thue-vps\/\" target=\"_blank\" rel=\"noopener\">xem c\u00e1c g\u00f3i VPS t\u1ea1i InterData<\/a> ho\u1eb7c <a href=\"https:\/\/interdata.vn\/cloud-server\/\" target=\"_blank\" rel=\"noopener\">c\u00e1c g\u00f3i Cloud Server<\/a> \u0111\u1ec3 b\u1eaft \u0111\u1ea7u ngay. Gh\u00e9 <a href=\"https:\/\/interdata.vn\/canhme\/\" target=\"_blank\" rel=\"noopener\">Canh Me<\/a> tr\u01b0\u1edbc khi ch\u1ed1t \u0111\u1ec3 kh\u00f4ng b\u1ecf l\u1ee1 deal \u0111ang ch\u1ea1y.<\/p>\n<\/div>\n<p style=\"text-align: justify; font-size: 13px; font-style: italic; color: #6b7280; margin-top: 30px; border-top: 1px solid #E5E7EB; padding-top: 15px;\"><span style=\"font-size: 100%;\"><em>N\u1ed9i dung mang t\u00ednh tham kh\u1ea3o. C\u00e1c l\u1ec7nh v\u00e0 c\u1ea5u h\u00ecnh UFW c\u00f3 th\u1ec3 kh\u00e1c nhau t\u00f9y phi\u00ean b\u1ea3n Ubuntu (20.04\/22.04\/24.04), phi\u00ean b\u1ea3n UFW, m\u00f4i tr\u01b0\u1eddng th\u1ef1c t\u1ebf v\u00e0 c\u00e1c ph\u1ea7n m\u1ec1m \u0111ang ch\u1ea1y tr\u00ean server (\u0111\u1eb7c bi\u1ec7t Docker). N\u00ean ki\u1ec3m th\u1eed tr\u00ean m\u00f4i tr\u01b0\u1eddng staging, sao l\u01b0u d\u1eef li\u1ec7u v\u00e0 \u0111\u1ea3m b\u1ea3o c\u00f3 ph\u01b0\u01a1ng \u00e1n truy c\u1eadp d\u1ef1 ph\u00f2ng (VNC\/console) tr\u01b0\u1edbc khi \u00e1p d\u1ee5ng cho production.<\/em><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>C\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh UFW l\u00e0 b\u01b0\u1edbc b\u1ea3o m\u1eadt \u0111\u1ea7u ti\u00ean m\u00e0 b\u1ea5t k\u1ef3 ai thu\u00ea VPS ch\u1ea1y Ubuntu \u0111\u1ec1u ph\u1ea3i l\u00e0m nh\u01b0ng c\u0169ng l\u00e0 b\u01b0\u1edbc khi\u1ebfn nhi\u1ec1u ng\u01b0\u1eddi m\u1ea5t tr\u1eafng k\u1ebft n\u1ed1i SSH v\u00ec b\u1eadt firewall m\u00e0 qu\u00ean m\u1edf port. B\u00e0i vi\u1ebft n\u00e0y t\u1eeb InterData h\u01b0\u1edbng d\u1eabn b\u1ea1n t\u1eebng b\u01b0\u1edbc c\u00e0i \u0111\u1eb7t, c\u1ea5u<\/p>\n","protected":false},"author":2,"featured_media":43429,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[161],"tags":[],"class_list":["post-43424","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-huong-dan-chung"],"_links":{"self":[{"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/posts\/43424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/comments?post=43424"}],"version-history":[{"count":5,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/posts\/43424\/revisions"}],"predecessor-version":[{"id":43433,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/posts\/43424\/revisions\/43433"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/media\/43429"}],"wp:attachment":[{"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/media?parent=43424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/categories?post=43424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/tags?post=43424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}