{"id":43845,"date":"2026-10-12T09:38:12","date_gmt":"2026-10-12T02:38:12","guid":{"rendered":"https:\/\/interdata.vn\/blog\/?p=43845"},"modified":"2026-10-12T09:38:12","modified_gmt":"2026-10-12T02:38:12","slug":"lenh-ss-trong-linux","status":"publish","type":"post","link":"https:\/\/interdata.vn\/blog\/lenh-ss-trong-linux\/","title":{"rendered":"H\u01b0\u1edbng D\u1eabn S\u1eed D\u1ee5ng L\u1ec7nh ss Trong Linux &#8211; Ki\u1ec3m Tra Port V\u00e0 Network"},"content":{"rendered":"<p style=\"text-align: justify; font-size: 16px; line-height: 1.6; margin-bottom: 20px;\">L\u1ec7nh ss l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 d\u00f2ng l\u1ec7nh m\u1ea1nh m\u1ebd thu\u1ed9c g\u00f3i iproute2, \u0111\u01b0\u1ee3c thi\u1ebft k\u1ebf chuy\u00ean bi\u1ec7t \u0111\u1ec3 hi\u1ec3n th\u1ecb chi ti\u1ebft c\u00e1c k\u1ebft n\u1ed1i m\u1ea1ng, socket v\u00e0 ki\u1ec3m tra port \u0111ang m\u1edf. Nh\u1edd c\u01a1 ch\u1ebf giao ti\u1ebfp tr\u1ef1c ti\u1ebfp v\u1edbi kernel, l\u1ec7nh ss \u0111em l\u1ea1i t\u1ed1c \u0111\u1ed9 truy v\u1ea5n truy xu\u1ea5t th\u00f4ng tin cao h\u01a1n h\u1eb3n c\u00e1c c\u00f4ng c\u1ee5 ph\u00e2n t\u00edch m\u1ea1ng c\u0169. B\u00e0i vi\u1ebft n\u00e0y cung c\u1ea5p cho b\u1ea1n c\u00fa ph\u00e1p chu\u1ea9n x\u00e1c, c\u00e1c tu\u1ef3 ch\u1ecdn c\u1ed1t l\u00f5i v\u00e0 h\u01b0\u1edbng d\u1eabn x\u1eed l\u00fd s\u1ef1 c\u1ed1 m\u1ea1ng th\u1ef1c t\u1ebf tr\u00ean h\u1ea1 t\u1ea7ng c\u1ee7a <a style=\"color: #2563eb; text-decoration: none; font-weight: bold;\" href=\"\/\">InterData<\/a>.<\/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. L\u1ec7nh ss l\u00e0 g\u00ec? T\u1ea1i sao n\u00ean d\u00f9ng thay th\u1ebf netstat tr\u00ean Linux?<\/a><\/li>\n<li style=\"margin-bottom: 10px;\"><a style=\"text-decoration: none; color: #2563eb; font-weight: bold;\" href=\"#section2\">2. So s\u00e1nh ss v\u00e0 netstat: L\u1ef1a ch\u1ecdn n\u00e0o t\u1ed1t h\u01a1n cho server?<\/a><\/li>\n<li style=\"margin-bottom: 10px;\"><a style=\"text-decoration: none; color: #2563eb; font-weight: bold;\" href=\"#section3\">3. C\u00e1c t\u00f9y ch\u1ecdn (flag) c\u1ed1t l\u00f5i trong l\u1ec7nh ss c\u1ea7n n\u1eafm v\u1eefng<\/a><\/li>\n<li style=\"margin-bottom: 10px;\"><a style=\"text-decoration: none; color: #2563eb; font-weight: bold;\" href=\"#section4\">4. Use case 1: L\u1ec7nh ss ki\u1ec3m tra port \u0111ang m\u1edf tr\u00ean VPS (Web, Database, SSH)<\/a><\/li>\n<li style=\"margin-bottom: 10px;\"><a style=\"text-decoration: none; color: #2563eb; font-weight: bold;\" href=\"#section5\">5. Use case 2: L\u1ec7nh ss ki\u1ec3m tra k\u1ebft n\u1ed1i m\u1ea1ng v\u00e0 l\u1ecdc theo tr\u1ea1ng th\u00e1i TCP<\/a><\/li>\n<li style=\"margin-bottom: 10px;\"><a style=\"text-decoration: none; color: #2563eb; font-weight: bold;\" href=\"#section6\">6. B\u1ea3o m\u1eadt n\u00e2ng cao: Qu\u1ea3n l\u00fd k\u1ebft n\u1ed1i m\u1ea1ng sau khi audit port<\/a><\/li>\n<li style=\"margin-bottom: 10px;\"><a style=\"text-decoration: none; color: #2563eb; font-weight: bold;\" href=\"#section7\">7. Troubleshooting: C\u00e1c l\u1ed7i th\u01b0\u1eddng g\u1eb7p khi s\u1eed d\u1ee5ng l\u1ec7nh ss<\/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-755409136\" class=\"gap-element clearfix\" style=\"display:block; height:auto;\">\n\t\t\n<style>\n#gap-755409136 {\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;\">1. L\u1ec7nh ss l\u00e0 g\u00ec? T\u1ea1i sao n\u00ean d\u00f9ng thay th\u1ebf netstat tr\u00ean Linux?<\/h2>\n<p style=\"text-align: justify;\">L\u1ec7nh ss (vi\u1ebft t\u1eaft c\u1ee7a socket statistics) l\u00e0 c\u00f4ng c\u1ee5 tr\u00ean <a style=\"color: #2563eb; text-decoration: none;\" href=\"https:\/\/interdata.vn\/blog\/he-dieu-hanh-linux-la-gi\/\">h\u1ec7 \u0111i\u1ec1u h\u00e0nh Linux<\/a> d\u00f9ng \u0111\u1ec3 gi\u00e1m s\u00e1t k\u1ebft n\u1ed1i m\u1ea1ng, TCP\/UDP socket v\u00e0 li\u1ec7t k\u00ea c\u00e1c port \u0111ang l\u1eafng nghe. Kh\u00e1c v\u1edbi netstat ph\u00e2n t\u00edch file t\u0129nh, l\u1ec7nh ss truy v\u1ea5n tr\u1ef1c ti\u1ebfp t\u1eeb kernel space qua giao th\u1ee9c netlink, mang l\u1ea1i t\u1ed1c \u0111\u1ed9 th\u1ed1ng k\u00ea t\u00ednh b\u1eb1ng mili-gi\u00e2y.<\/p>\n<p style=\"text-align: justify;\">Khi b\u1ea1n v\u1eadn h\u00e0nh m\u1ed9t <a style=\"color: #2563eb; text-decoration: none;\" href=\"https:\/\/interdata.vn\/blog\/vps-la-gi\/\">m\u00e1y ch\u1ee7 VPS<\/a>, vi\u1ec7c x\u00e1c \u0111\u1ecbnh ch\u00ednh x\u00e1c ti\u1ebfn tr\u00ecnh n\u00e0o \u0111ang chi\u1ebfm d\u1ee5ng c\u1ed5ng m\u1ea1ng (port) l\u00e0 k\u1ef9 n\u0103ng b\u1eaft bu\u1ed9c. C\u00e1c phi\u00ean b\u1ea3n ph\u00e2n ph\u1ed1i hi\u1ec7n \u0111\u1ea1i \u0111\u00e3 ng\u1eebng h\u1ed7 tr\u1ee3 g\u00f3i <code>net-tools<\/code> (ch\u1ee9a netstat) v\u00e0 chuy\u1ec3n sang s\u1eed d\u1ee5ng b\u1ed9 c\u00f4ng c\u1ee5 <code>iproute2<\/code> (ch\u1ee9a ss) l\u00e0m ti\u00eau chu\u1ea9n m\u1eb7c \u0111\u1ecbnh.<\/p>\n<p style=\"text-align: justify;\">\u0110i\u1ec1u n\u00e0y \u0111\u1ed3ng ngh\u0129a v\u1edbi vi\u1ec7c am hi\u1ec3u l\u1ec7nh ss s\u1ebd gi\u00fap b\u1ea1n ch\u1ea9n \u0111o\u00e1n c\u00e1c s\u1ef1 c\u1ed1 r\u1edbt m\u1ea1ng, tr\u00e0n k\u1ebft n\u1ed1i ho\u1eb7c ph\u00e1t hi\u1ec7n c\u00e1c ti\u1ebfn tr\u00ecnh backdoor chi\u1ebfm port tr\u00e1i ph\u00e9p m\u1ed9t c\u00e1ch nhanh ch\u00f3ng.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-43854\" src=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/10\/Lenh-ss.jpg\" alt=\"L\u1ec7nh ss\" width=\"600\" height=\"400\" title=\"\" srcset=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/10\/Lenh-ss.jpg 750w, https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/10\/Lenh-ss-300x200.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/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: 32px; font-family: 'Be Vietnam Pro', sans-serif; font-weight: bold; margin: 0; line-height: 1.2;\">VPS Hi\u1ec7u N\u0103ng<br \/>\nCao<\/p>\n<p style=\"color: #dbeafe; font-size: 14px; font-weight: 600; margin-top: 12px;\">\u1ed4 c\u1ee9ng NVMe U.2 &#8211; To\u00e0n quy\u1ec1n Root<\/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;\">C\u1ea7n kh\u00f4ng gian \u0111\u1ed9c l\u1eadp \u0111\u1ec3 ch\u1ea1y d\u1ef1 \u00e1n &amp; t\u1ed1i \u01b0u m\u00e1y ch\u1ee7?<\/h3>\n<p style=\"text-align: justify; font-size: 15px; margin-bottom: 15px;\">\u0110\u1ec3 t\u1ef1 do m\u1edf port, c\u1ea5u h\u00ecnh Web Server, Database hay VPN ri\u00eang, b\u1ea1n c\u1ea7n <strong>to\u00e0n quy\u1ec1n qu\u1ea3n tr\u1ecb (Root)<\/strong>. VPS t\u1ea1i InterData kh\u00f4ng ch\u1ec9 c\u1ea5p quy\u1ec1n t\u1ed1i cao m\u00e0 c\u00f2n b\u1ee9t ph\u00e1 t\u1ed1c \u0111\u1ed9 v\u1edbi \u1ed5 c\u1ee9ng NVMe U.2, gi\u00fap h\u1ec7 th\u1ed1ng c\u1ee7a b\u1ea1n lu\u00f4n ph\u1ea3n h\u1ed3i t\u1ee9c th\u00ec, kh\u00f4ng \u0111\u1ed9 tr\u1ec5.<\/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\">Thu\u00ea VPS T\u1ed1c \u0110\u1ed9 Cao Ngay \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;\">2. So s\u00e1nh ss v\u00e0 netstat: L\u1ef1a ch\u1ecdn n\u00e0o t\u1ed1t h\u01a1n cho server?<\/h2>\n<p style=\"text-align: justify;\">Nhi\u1ec1u qu\u1ea3n tr\u1ecb vi\u00ean l\u00e2u n\u0103m v\u1eabn quen g\u00f5 netstat \u0111\u1ec3 xem port. Tuy nhi\u00ean, d\u00f9 b\u1ea1n d\u00f9ng <a style=\"color: #2563eb; text-decoration: none;\" href=\"https:\/\/interdata.vn\/blog\/nen-chon-centos-ubuntu-hay-debian-cho-vps-linux\/\">CentOS, Ubuntu hay Debian<\/a>, c\u00f4ng c\u1ee5 ss hi\u1ec7n \u0111\u00e3 \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t m\u1eb7c \u0111\u1ecbnh v\u00e0 c\u00f3 ki\u1ebfn tr\u00fac x\u1eed l\u00fd v\u01b0\u1ee3t tr\u1ed9i h\u01a1n. D\u01b0\u1edbi \u0111\u00e2y l\u00e0 b\u1ea3ng ph\u00e2n t\u00edch k\u1ef9 thu\u1eadt gi\u1eefa hai l\u1ec7nh n\u00e0y:<\/p>\n<table style=\"width: 100%; border-collapse: collapse; margin-bottom: 25px; font-size: 15px; text-align: left;\">\n<thead>\n<tr style=\"background-color: #f1f5f9; border-bottom: 2px solid #2563EB;\">\n<th style=\"padding: 12px 15px; color: #1e3a8a;\">Ti\u00eau ch\u00ed ph\u00e2n t\u00edch<\/th>\n<th style=\"padding: 12px 15px; color: #1e3a8a;\">L\u1ec7nh ss (Socket Statistics)<\/th>\n<th style=\"padding: 12px 15px; color: #1e3a8a;\">L\u1ec7nh netstat (Net-tools)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"border-bottom: 1px solid #E2E8F0;\">\n<td style=\"padding: 12px 15px; font-weight: 600;\">C\u01a1 ch\u1ebf truy xu\u1ea5t d\u1eef li\u1ec7u<\/td>\n<td style=\"padding: 12px 15px;\">D\u00f9ng giao th\u1ee9c <code>NETLINK<\/code> \u0111\u1ec3 nh\u1eadn API th\u1eb3ng t\u1eeb Kernel.<\/td>\n<td style=\"padding: 12px 15px;\">\u0110\u1ecdc tu\u1ea7n t\u1ef1 file text h\u1ec7 th\u1ed1ng <code>\/proc\/net\/tcp<\/code>.<\/td>\n<\/tr>\n<tr style=\"border-bottom: 1px solid #E2E8F0;\">\n<td style=\"padding: 12px 15px; font-weight: 600;\">T\u1ed1c \u0111\u1ed9 x\u1eed l\u00fd (Performance)<\/td>\n<td style=\"padding: 12px 15px;\">Ph\u1ea3n h\u1ed3i t\u1ee9c th\u00ec ngay c\u1ea3 khi server b\u1ecb ngh\u1ebdn (c\u00f3 h\u00e0ng ch\u1ee5c ngh\u00ecn k\u1ebft n\u1ed1i).<\/td>\n<td style=\"padding: 12px 15px;\">G\u00e2y treo terminal ho\u1eb7c ng\u1ed1n CPU khi parse d\u1eef li\u1ec7u t\u1eeb l\u01b0\u1ee3ng k\u1ebft n\u1ed1i l\u1edbn.<\/td>\n<\/tr>\n<tr style=\"border-bottom: 1px solid #E2E8F0;\">\n<td style=\"padding: 12px 15px; font-weight: 600;\">Chi ti\u1ebft c\u1ea5u tr\u00fac m\u1ea1ng<\/td>\n<td style=\"padding: 12px 15px;\">Hi\u1ec3n th\u1ecb s\u00e2u c\u00e1c s\u1ed1 li\u1ec7u TCP internal (timer, congestion window).<\/td>\n<td style=\"padding: 12px 15px;\">Ch\u1ec9 li\u1ec7t k\u00ea \u0111\u1ecba ch\u1ec9, tr\u1ea1ng th\u00e1i c\u1ed5ng m\u1ea1ng c\u01a1 b\u1ea3n.<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 12px 15px; font-weight: 600;\">T\u00ecnh tr\u1ea1ng h\u1ed7 tr\u1ee3 (Support)<\/td>\n<td style=\"padding: 12px 15px;\">\u0110\u01b0\u1ee3c duy tr\u00ec v\u00e0 c\u1eadp nh\u1eadt li\u00ean t\u1ee5c b\u1edfi c\u1ed9ng \u0111\u1ed3ng Linux.<\/td>\n<td style=\"padding: 12px 15px;\">\u0110\u00e3 b\u1ecb deprecated (ng\u1eebng ph\u00e1t tri\u1ec3n) tr\u00ean nhi\u1ec1u distro m\u1edbi.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\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;\">3. C\u00e1c t\u00f9y ch\u1ecdn (flag) c\u1ed1t l\u00f5i trong l\u1ec7nh ss c\u1ea7n n\u1eafm v\u1eefng<\/h2>\n<p style=\"text-align: justify;\">Gi\u1ed1ng nh\u01b0 m\u1ecdi c\u00f4ng c\u1ee5 d\u00f2ng l\u1ec7nh kh\u00e1c, s\u1ee9c m\u1ea1nh c\u1ee7a ss n\u1eb1m \u1edf c\u00e1c c\u1edd (flag) l\u1ecdc d\u1eef li\u1ec7u. N\u1ebfu b\u1ea1n g\u00f5 <code>ss<\/code> m\u00e0 kh\u00f4ng \u0111i k\u00e8m c\u1edd n\u00e0o, h\u1ec7 th\u1ed1ng s\u1ebd in ra h\u00e0ng ngh\u00ecn d\u00f2ng k\u1ebft n\u1ed1i \u0111ang ho\u1ea1t \u0111\u1ed9ng (k\u1ec3 c\u1ea3 c\u00e1c socket UNIX n\u1ed9i b\u1ed9). \u0110\u1ec3 gi\u1edbi h\u1ea1n ph\u1ea1m vi t\u00ecm ki\u1ebfm, h\u00e3y k\u1ebft h\u1ee3p c\u00e1c tham s\u1ed1 sau:<\/p>\n<ul style=\"text-align: justify; line-height: 1.7; font-size: 16px;\">\n<li><code>-t<\/code> (&#8211;tcp): Ch\u1ec9 hi\u1ec3n th\u1ecb c\u00e1c socket thu\u1ed9c giao th\u1ee9c TCP.<\/li>\n<li><code>-u<\/code> (&#8211;udp): Ch\u1ec9 hi\u1ec3n th\u1ecb c\u00e1c socket thu\u1ed9c giao th\u1ee9c UDP.<\/li>\n<li><code>-l<\/code> (&#8211;listening): L\u1ecdc v\u00e0 ch\u1ec9 hi\u1ec7n c\u00e1c port \u0111ang \u1edf tr\u1ea1ng th\u00e1i LISTEN (ch\u1edd ti\u1ebfp nh\u1eadn k\u1ebft n\u1ed1i).<\/li>\n<li><code>-n<\/code> (&#8211;numeric): B\u1ecf qua b\u01b0\u1edbc ph\u00e2n gi\u1ea3i t\u00ean mi\u1ec1n (DNS resolution) v\u00e0 t\u00ean d\u1ecbch v\u1ee5. K\u1ebft qu\u1ea3 tr\u1ea3 v\u1ec1 IP v\u00e0 s\u1ed1 port d\u1ea1ng g\u1ed1c, gi\u00fap c\u00e2u l\u1ec7nh ch\u1ea1y kh\u00f4ng b\u1ecb delay.<\/li>\n<li><code>-p<\/code> (&#8211;processes): B\u1ed5 sung c\u1ed9t Process ID (PID) v\u00e0 t\u00ean ph\u1ea7n m\u1ec1m \u0111ang m\u1edf port \u0111\u00f3. C\u1edd n\u00e0y y\u00eau c\u1ea7u quy\u1ec1n <code>root<\/code> ho\u1eb7c <code>sudo<\/code>.<\/li>\n<li><code>-s<\/code> (&#8211;summary): Hi\u1ec3n th\u1ecb th\u1ed1ng k\u00ea t\u1ed5ng quan (s\u1ed1 l\u01b0\u1ee3ng socket hi\u1ec7n t\u1ea1i ph\u00e2n theo TCP, UDP, RAW).<\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><strong>L\u1ec7nh ss -tuln c\u00f3 ngh\u0129a g\u00ec?<\/strong> \u0110\u00e2y l\u00e0 chu\u1ed7i c\u1edd \u0111\u01b0\u1ee3c d\u00f9ng ph\u1ed5 bi\u1ebfn nh\u1ea5t tr\u00ean m\u1ecdi server. Khi b\u1ea1n g\u1ed9p <code>-t<\/code> (TCP), <code>-u<\/code> (UDP), <code>-l<\/code> (Listen) v\u00e0 <code>-n<\/code> (Numeric) l\u1ea1i, h\u1ec7 th\u1ed1ng s\u1ebd tr\u1ea3 v\u1ec1 ch\u00ednh x\u00e1c danh s\u00e1ch c\u00e1c c\u1ed5ng m\u1ea1ng \u0111ang tr\u1ef1c ti\u1ebfp m\u1edf \u0111\u1ec3 l\u1eafng nghe th\u1ebf gi\u1edbi b\u00ean ngo\u00e0i m\u00e0 kh\u00f4ng ph\u00e2n gi\u1ea3i DNS r\u01b0\u1eddm r\u00e0.<\/p>\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;\">4. Use case 1: L\u1ec7nh ss ki\u1ec3m tra port \u0111ang m\u1edf tr\u00ean VPS (Web, Database, SSH)<\/h2>\n<p style=\"text-align: justify;\">Qu\u00e1 tr\u00ecnh tri\u1ec3n khai d\u1ecbch v\u1ee5 lu\u00f4n \u0111i k\u00e8m v\u1edbi vi\u1ec7c x\u00e1c minh c\u1ed5ng m\u1ea1ng. D\u01b0\u1edbi \u0111\u00e2y l\u00e0 c\u00e1c k\u1ecbch b\u1ea3n thao t\u00e1c l\u1ec7nh th\u1ef1c t\u1ebf.<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin-top: 25px;\">Ki\u1ec3m tra Web Server (Nginx \/ Apache) \u0111ang ch\u1ea1y port n\u00e0o<\/h3>\n<p style=\"text-align: justify;\">Ngay sau qu\u00e1 tr\u00ecnh <a style=\"color: #2563eb; text-decoration: none;\" href=\"https:\/\/interdata.vn\/blog\/cai-dat-nginx-php-mysql-tren-ubuntu-vps\/\">c\u00e0i \u0111\u1eb7t LEMP stack<\/a>, b\u1ea1n c\u1ea7n \u0111\u1ea3m b\u1ea3o Nginx \u0111\u00e3 binding th\u00e0nh c\u00f4ng l\u00ean port 80 (HTTP) v\u00e0 443 (HTTPS). S\u1eed d\u1ee5ng c\u1edd <code>-tulnp<\/code> k\u1ebft h\u1ee3p <code>grep<\/code> \u0111\u1ec3 tr\u00edch xu\u1ea5t d\u00f2ng ch\u1ee9a Nginx:<\/p>\n<pre><code class=\"language-bash\">sudo ss -tulnp | grep nginx<\/code><\/pre>\n<p style=\"text-align: justify;\">C\u1ea5u tr\u00fac k\u1ebft qu\u1ea3 tr\u1ea3 v\u1ec1 s\u1ebd hi\u1ec3n th\u1ecb \u0111\u1ea7y \u0111\u1ee7 th\u00f4ng tin:<\/p>\n<pre><code>tcp   LISTEN   0   511   0.0.0.0:80    0.0.0.0:*   users:((\"nginx\",pid=1234,fd=6))\r\ntcp   LISTEN   0   511   0.0.0.0:443   0.0.0.0:*   users:((\"nginx\",pid=1234,fd=7))<\/code><\/pre>\n<p style=\"text-align: justify;\">Trong \u0111\u00f3, c\u1ed9t <code>Local Address:Port<\/code> ghi nh\u1eadn <code>0.0.0.0:80<\/code> cho bi\u1ebft Web Server \u0111ang cho ph\u00e9p m\u1ecdi IP truy c\u1eadp t\u1eeb b\u00ean ngo\u00e0i v\u00e0o port 80. C\u1ed9t cu\u1ed1i c\u00f9ng x\u00e1c nh\u1eadn PID c\u1ee7a Nginx l\u00e0 1234.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43853\" src=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/10\/Kiem-tra-Web-Server-Nginx-_-Apache-dang-chay-port-nao.jpg\" alt=\"Ki\u1ec3m tra Web Server (Nginx _ Apache) \u0111ang ch\u1ea1y port n\u00e0o\" width=\"750\" height=\"500\" title=\"\" srcset=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/10\/Kiem-tra-Web-Server-Nginx-_-Apache-dang-chay-port-nao.jpg 750w, https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/10\/Kiem-tra-Web-Server-Nginx-_-Apache-dang-chay-port-nao-300x200.jpg 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/p>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin-top: 25px;\">Ki\u1ec3m tra d\u1ecbch v\u1ee5 qu\u1ea3n tr\u1ecb t\u1eeb xa (SSH)<\/h3>\n<p style=\"text-align: justify;\">Vi\u1ec7c thay \u0111\u1ed5i port m\u1eb7c \u0111\u1ecbnh c\u1ee7a giao th\u1ee9c <a style=\"color: #2563eb; text-decoration: none;\" href=\"https:\/\/interdata.vn\/blog\/ssh-la-gi\/\">SSH (Secure Shell)<\/a> l\u00e0 th\u00f3i quen b\u1ea3o m\u1eadt c\u01a1 b\u1ea3n. Tr\u01b0\u1edbc khi thay \u0111\u1ed5i rule firewall, b\u1ea1n ph\u1ea3i x\u00e1c minh ti\u1ebfn tr\u00ecnh <code>sshd<\/code> \u0111\u00e3 nh\u1eadn di\u1ec7n port m\u1edbi b\u1eb1ng c\u00e1ch ch\u1ea1y l\u1ec7nh:<\/p>\n<pre><code class=\"language-bash\">sudo ss -tulnp | grep sshd<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43851\" src=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/10\/Kiem-tra-dich-vu-quan-tri-tu-xa-SSH.jpg\" alt=\"Ki\u1ec3m tra d\u1ecbch v\u1ee5 qu\u1ea3n tr\u1ecb t\u1eeb xa (SSH)\" width=\"750\" height=\"500\" title=\"\" srcset=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/10\/Kiem-tra-dich-vu-quan-tri-tu-xa-SSH.jpg 750w, https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/10\/Kiem-tra-dich-vu-quan-tri-tu-xa-SSH-300x200.jpg 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/p>\n<p style=\"text-align: justify;\">Theo <a style=\"color: #2563eb; text-decoration: none;\" href=\"https:\/\/interdata.vn\/blog\/huong-dan-su-dung-vps\/\">h\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng VPS<\/a> chu\u1ea9n, m\u1ecdi d\u1ecbch v\u1ee5 h\u1ec7 th\u1ed1ng khi m\u1edbi kh\u1edfi ch\u1ea1y l\u1ea1i (restart) \u0111\u1ec1u c\u1ea7n \u0111\u01b0\u1ee3c audit l\u1ea1i port. \u0110\u1eb7c bi\u1ec7t \u0111\u1ed1i v\u1edbi c\u00e1c h\u1ec7 th\u1ed1ng t\u00e0i nguy\u00ean h\u1ea1n ch\u1ebf nh\u01b0 c\u1ea5u h\u00ecnh <a style=\"color: #2563eb; text-decoration: none;\" href=\"https:\/\/interdata.vn\/blog\/vps-1-core-1gb-ram-lam-duoc-gi\/\">VPS 1 Core 1GB RAM<\/a>, ch\u1ea1y c\u00e2u l\u1ec7nh ss ti\u00eau t\u1ed1n c\u1ef1c \u00edt b\u1ed9 nh\u1edb RAM so v\u1edbi vi\u1ec7c duy tr\u00ec c\u00e1c control panel gi\u00e1m s\u00e1t n\u1eb7ng n\u1ec1.<\/p>\n<div style=\"background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%); border: 1.5px dashed #2563EB; border-radius: 12px; padding: 28px; margin: 35px 0; text-align: center; position: relative;\">\n<p><span style=\"position: absolute; top: -15px; left: 50%; transform: translateX(-50%); background: #EF4444; color: white; padding: 5px 15px; border-radius: 20px; font-weight: bold; font-size: 13px; box-shadow: 0 4px 6px rgba(0,0,0,0.1);\">M\u1eb9o cho Sysadmin<\/span><\/p>\n<p style=\"font-family: 'Be Vietnam Pro', sans-serif; font-size: 22px; font-weight: bold; color: #1e3a8a; margin: 10px 0 8px;\">\u0110\u1eebng v\u1ed9i thanh to\u00e1n VPS\/Cloud n\u1ebfu ch\u01b0a check \u01b0u \u0111\u00e3i!<\/p>\n<p style=\"font-size: 15px; color: #4b5563; margin-bottom: 20px; line-height: 1.6;\">H\u00e3y l\u00e0 m\u1ed9t nh\u00e0 qu\u1ea3n tr\u1ecb th\u00f4ng th\u00e1i! Gh\u00e9 ngay <strong>Canh Me<\/strong> \u0111\u1ec3 &#8220;b\u1ecf t\u00fai&#8221; c\u00e1c \u01b0u \u0111\u00e3i ti\u1ebft ki\u1ec7m \u0111\u1ed9c quy\u1ec1n (l\u00ean t\u1edbi 40% &#8211; 50%) ho\u1eb7c \u01b0u \u0111\u00e3i t\u1eb7ng th\u00eam th\u00e1ng t\u1eeb InterData. Khuy\u1ebfn m\u00e3i t\u1ed1t th\u01b0\u1eddng h\u1ebft l\u01b0\u1ee3t d\u00f9ng r\u1ea5t nhanh!<\/p>\n<p><a style=\"background: #2563EB; color: #fff; padding: 12px 30px; text-decoration: none; font-weight: 600; border-radius: 8px; display: inline-block; transition: all 0.3s;\" href=\"https:\/\/interdata.vn\/canhme\/\" target=\"_blank\" rel=\"noopener\">S\u0103n \u01afu \u0110\u00e3i Ti\u1ebft Ki\u1ec7m M\u1edbi Nh\u1ea5t T\u1ea1i Canh Me \u27f6<\/a><\/p>\n<\/div>\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;\">5. Use case 2: L\u1ec7nh ss ki\u1ec3m tra k\u1ebft n\u1ed1i m\u1ea1ng v\u00e0 l\u1ecdc theo tr\u1ea1ng th\u00e1i TCP<\/h2>\n<p style=\"text-align: justify;\">C\u00e1c port LISTEN m\u1edbi ch\u1ec9 cho bi\u1ebft d\u1ecbch v\u1ee5 \u0111ang m\u1edf c\u1eeda. \u0110\u1ec3 xem c\u00f3 bao nhi\u00eau client \u0111ang tr\u1ef1c ti\u1ebfp trao \u0111\u1ed5i d\u1eef li\u1ec7u, b\u1ea1n c\u1ea7n l\u1ecdc k\u1ebft n\u1ed1i theo tr\u1ea1ng th\u00e1i (State). C\u00e1c tr\u1ea1ng th\u00e1i TCP quan tr\u1ecdng bao g\u1ed3m <code>ESTABLISHED<\/code> (\u0111ang k\u1ebft n\u1ed1i), <code>TIME-WAIT<\/code> (ch\u1edd \u0111\u00f3ng k\u1ebft n\u1ed1i), v\u00e0 <code>SYN-RECV<\/code> (\u0111ang b\u1eaft tay nh\u1eadn k\u1ebft n\u1ed1i).<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin-top: 25px;\">L\u1ecdc c\u00e1c k\u1ebft n\u1ed1i \u0111ang duy tr\u00ec (ESTABLISHED)<\/h3>\n<p style=\"text-align: justify;\">\u0110\u1ec3 li\u1ec7t k\u00ea to\u00e0n b\u1ed9 c\u00e1c \u0111\u1ecba ch\u1ec9 IP \u0111ang th\u1ef1c s\u1ef1 t\u1ea3i d\u1eef li\u1ec7u t\u1eeb m\u00e1y ch\u1ee7 web c\u1ee7a b\u1ea1n qua port 443, h\u00e3y d\u00f9ng c\u00fa ph\u00e1p state k\u1ebft h\u1ee3p b\u1ed9 l\u1ecdc destination port (dport):<\/p>\n<pre><code class=\"language-bash\">ss -nt state established '( sport = :443 )'<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43855\" src=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/10\/Loc-cac-ket-noi-dang-duy-tri-ESTABLISHED.jpg\" alt=\"L\u1ecdc c\u00e1c k\u1ebft n\u1ed1i \u0111ang duy tr\u00ec (ESTABLISHED)\" width=\"750\" height=\"500\" title=\"\" srcset=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/10\/Loc-cac-ket-noi-dang-duy-tri-ESTABLISHED.jpg 750w, https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/10\/Loc-cac-ket-noi-dang-duy-tri-ESTABLISHED-300x200.jpg 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/p>\n<h3 style=\"color: #1e3a8a; font-size: 20px; font-weight: 600; margin-top: 25px;\">Ki\u1ec3m tra t\u1ed5ng l\u01b0\u1ee3ng k\u1ebft n\u1ed1i b\u1eb1ng ss -s<\/h3>\n<p style=\"text-align: justify;\">Thay v\u00ec \u0111\u1ebfm th\u1ee7 c\u00f4ng h\u00e0ng ngh\u00ecn d\u00f2ng log, b\u1ea1n c\u00f3 th\u1ec3 g\u1ecdi c\u1edd <code>-s<\/code> \u0111\u1ec3 l\u1ec7nh ss t\u1ed5ng h\u1ee3p l\u1ea1i s\u1ed1 l\u01b0\u1ee3ng socket m\u00e0 kernel \u0111ang x\u1eed l\u00fd. D\u1eef li\u1ec7u n\u00e0y gi\u00fap sysadmin bi\u1ebft \u0111\u01b0\u1ee3c c\u00f3 d\u1ea5u hi\u1ec7u ngh\u1ebdn c\u1ed5 chai m\u1ea1ng hay kh\u00f4ng.<\/p>\n<pre><code class=\"language-bash\">ss -s<\/code><\/pre>\n<pre><code>Total: 154\r\nTCP:   320 (estab 45, closed 205, orphaned 0, timewait 180)\r\n\r\nTransport Total     IP        IPv6\r\nRAW       1         0         1\r\nUDP       12        9         3\r\nTCP       115       100       15<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43852\" src=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/10\/Kiem-tra-tong-luong-ket-noi-bang-ss-s.jpg\" alt=\"Ki\u1ec3m tra t\u1ed5ng l\u01b0\u1ee3ng k\u1ebft n\u1ed1i b\u1eb1ng ss -s\" width=\"750\" height=\"500\" title=\"\" srcset=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/10\/Kiem-tra-tong-luong-ket-noi-bang-ss-s.jpg 750w, https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/10\/Kiem-tra-tong-luong-ket-noi-bang-ss-s-300x200.jpg 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/p>\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;\">6. B\u1ea3o m\u1eadt n\u00e2ng cao: Qu\u1ea3n l\u00fd k\u1ebft n\u1ed1i m\u1ea1ng sau khi audit port<\/h2>\n<p style=\"text-align: justify;\">T\u00ecm ra port l\u1ea1 b\u1eb1ng l\u1ec7nh ss ch\u1ec9 l\u00e0 b\u01b0\u1edbc chu\u1ea9n \u0111o\u00e1n \u0111\u1ea7u ti\u00ean. N\u1ebfu ph\u00e1t hi\u1ec7n m\u1ed9t ti\u1ebfn tr\u00ecnh kh\u00f4ng r\u00f5 ngu\u1ed3n g\u1ed1c (v\u00ed d\u1ee5: malware khai th\u00e1c l\u1ed7 h\u1ed5ng) \u0111ang m\u1edf c\u1ed5ng m\u1ea1ng 4444, b\u1ea1n c\u1ea7n \u00e1p d\u1ee5ng c\u00e1c nguy\u00ean t\u1eafc <a style=\"color: #2563eb; text-decoration: none;\" href=\"https:\/\/interdata.vn\/blog\/bao-mat-vps-linux\/\">b\u1ea3o m\u1eadt VPS Linux<\/a> ngay l\u1eadp t\u1ee9c.<\/p>\n<ol style=\"line-height: 1.8; text-align: justify; font-size: 16px;\">\n<li><strong>C\u00f4 l\u1eadp v\u00e0 ng\u1eaft ti\u1ebfn tr\u00ecnh:<\/strong> S\u1eed d\u1ee5ng l\u1ec7nh <code>kill -9 &lt;PID&gt;<\/code> \u0111\u1ec3 ch\u1ea5m d\u1ee9t ngay l\u1eadp t\u1ee9c process \u0111ang chi\u1ebfm d\u1ee5ng port. M\u00e3 PID n\u00e0y \u0111\u01b0\u1ee3c cung c\u1ea5p b\u1edfi c\u1edd <code>-p<\/code> c\u1ee7a ss.<\/li>\n<li><strong>Ch\u1eb7n tr\u00ean Firewall:<\/strong> K\u00edch ho\u1ea1t UFW ho\u1eb7c iptables ch\u1eb7n to\u00e0n b\u1ed9 giao ti\u1ebfp ra v\u00e0o \u1edf port nghi ng\u1edd. K\u1ebft h\u1ee3p v\u1edbi h\u01b0\u1edbng d\u1eabn <a style=\"color: #2563eb; text-decoration: none;\" href=\"https:\/\/interdata.vn\/blog\/cach-bao-mat-ssh-vps\/\">b\u1ea3o m\u1eadt SSH VPS<\/a> \u0111\u1ec3 v\u00f4 hi\u1ec7u h\u00f3a \u0111\u0103ng nh\u1eadp b\u1eb1ng m\u1eadt kh\u1ea9u, ch\u1ec9 cho ph\u00e9p d\u00f9ng SSH Key nh\u1eb1m tr\u00e1nh b\u1ecb brute-force t\u00e1i th\u00e2m nh\u1eadp.<\/li>\n<li><strong>Audit \u0111\u1ecbnh k\u1ef3:<\/strong> Tham kh\u1ea3o th\u00eam c\u00e1c chi\u1ebfn l\u01b0\u1ee3c <a style=\"color: #2563eb; text-decoration: none;\" href=\"https:\/\/interdata.vn\/blog\/huong-dan-tat-mo-port-tren-vps\/\">ki\u1ec3m tra port tr\u00ean VPS<\/a> \u0111\u1ecbnh k\u1ef3 b\u1eb1ng cronjob k\u1ebft h\u1ee3p ss \u0111\u1ec3 theo d\u00f5i bi\u1ebfn \u0111\u1ed9ng m\u1ea1ng.<\/li>\n<\/ol>\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<br \/>\nEnterprise<\/p>\n<p style=\"color: #dbeafe; font-size: 14px; font-weight: 600; margin-top: 12px;\">\u0110\u01b0\u1eddng truy\u1ec1n 10Gbps &#8211; Uptime 99.99%<\/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;\">L\u01b0\u1ee3ng TCP Socket t\u0103ng \u0111\u1ed9t bi\u1ebfn? Chuy\u1ec3n ngay l\u00ean Cloud!<\/h3>\n<p style=\"text-align: justify; font-size: 15px; margin-bottom: 15px;\">L\u1ec7nh <code>ss<\/code> cho th\u1ea5y l\u01b0\u1ee3ng k\u1ebft n\u1ed1i <em>ESTABLISHED<\/em> \u0111ang v\u1eaft ki\u1ec7t RAM c\u1ee7a b\u1ea1n? \u0110\u1ec3 \u1ee9ng d\u1ee5ng web kh\u00f4ng b\u1ecb ngh\u1ebdn c\u1ed5 chai \u1edf m\u00f4i tr\u01b0\u1eddng Production, <strong>Cloud Server InterData<\/strong> l\u00e0 gi\u1ea3i ph\u00e1p ho\u00e0n h\u1ea3o. N\u00e2ng c\u1ea5p t\u00e0i nguy\u00ean (CPU\/RAM) t\u1ee9c th\u00ec kh\u00f4ng gi\u00e1n \u0111o\u1ea1n, \u0111\u1ea3m b\u1ea3o x\u1eed l\u00fd m\u01b0\u1ee3t m\u00e0 h\u00e0ng ch\u1ee5c ng\u00e0n k\u1ebft n\u1ed1i \u0111\u1ed3ng th\u1eddi.<\/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 B\u1ea3ng Gi\u00e1 Cloud Server Ch\u1ecbu T\u1ea3i \u27f6<\/a><\/p>\n<\/div>\n<\/div>\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;\">7. Troubleshooting: C\u00e1c l\u1ed7i th\u01b0\u1eddng g\u1eb7p khi s\u1eed d\u1ee5ng l\u1ec7nh ss<\/h2>\n<p style=\"text-align: justify;\">Trong qu\u00e1 tr\u00ecnh ch\u1ea9n \u0111o\u00e1n s\u1ef1 c\u1ed1 m\u1ea1ng, b\u1ea1n c\u00f3 th\u1ec3 g\u1eb7p m\u1ed9t v\u00e0i c\u1ea3nh b\u00e1o v\u1ec1 quy\u1ec1n h\u1ea1n ho\u1eb7c qu\u00e1 t\u1ea3i terminal. D\u01b0\u1edbi \u0111\u00e2y l\u00e0 c\u00e1ch g\u1ee1 l\u1ed7i nhanh.<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 18px; font-weight: 600;\">L\u1ed7i 1: B\u00e1o l\u1ed7i &#8220;ss: command not found&#8221;<\/h3>\n<p style=\"text-align: justify;\"><strong>Tri\u1ec7u ch\u1ee9ng:<\/strong> G\u00f5 l\u1ec7nh ss tr\u1ea3 v\u1ec1 l\u1ed7i h\u1ec7 th\u1ed1ng kh\u00f4ng nh\u1eadn di\u1ec7n \u0111\u01b0\u1ee3c l\u1ec7nh.<\/p>\n<p style=\"text-align: justify;\"><strong>Nguy\u00ean nh\u00e2n:<\/strong> B\u1ea3n ph\u00e2n ph\u1ed1i Linux t\u1ed1i gi\u1ea3n (minimal) ch\u01b0a c\u00e0i s\u1eb5n g\u00f3i m\u1ea1ng m\u1eb7c \u0111\u1ecbnh.<\/p>\n<p style=\"text-align: justify;\"><strong>C\u00e1ch x\u1eed l\u00fd:<\/strong> C\u00e0i \u0111\u1eb7t l\u1ea1i g\u00f3i <code>iproute2<\/code>. Tr\u00ean Ubuntu\/Debian ch\u1ea1y: <code>sudo apt install iproute2 -y<\/code>. Tr\u00ean CentOS\/RHEL ch\u1ea1y: <code>sudo dnf install iproute -y<\/code>.<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 18px; font-weight: 600;\">L\u1ed7i 2: C\u1ed9t Process \/ PID b\u1ecb tr\u1ed1ng ho\u1eb7c kh\u00f4ng hi\u1ec3n th\u1ecb<\/h3>\n<p style=\"text-align: justify;\"><strong>Tri\u1ec7u ch\u1ee9ng:<\/strong> B\u1ea1n \u0111\u00e3 th\u00eam c\u1edd <code>-p<\/code> nh\u01b0ng c\u1ed9t PID cu\u1ed1i c\u00f9ng ho\u00e0n to\u00e0n tr\u1ed1ng.<\/p>\n<p style=\"text-align: justify;\"><strong>Nguy\u00ean nh\u00e2n:<\/strong> Do kernel b\u1ea3o m\u1eadt, t\u00e0i kho\u1ea3n user th\u00f4ng th\u01b0\u1eddng kh\u00f4ng \u0111\u01b0\u1ee3c ph\u00e9p xem ti\u1ebfn tr\u00ecnh do c\u00e1c t\u00e0i kho\u1ea3n kh\u00e1c t\u1ea1o ra.<\/p>\n<p style=\"text-align: justify;\"><strong>C\u00e1ch x\u1eed l\u00fd:<\/strong> \u0110\u1eb7t <code>sudo<\/code> tr\u01b0\u1edbc l\u1ec7nh \u0111\u1ec3 n\u00e2ng quy\u1ec1n. Ch\u1ea1y: <code>sudo ss -tulnp<\/code>.<\/p>\n<h3 style=\"color: #1e3a8a; font-size: 18px; font-weight: 600;\">L\u1ed7i 3: Terminal b\u1ecb tr\u00f4i v\u00e0 treo khi server b\u1ecb t\u1ea5n c\u00f4ng<\/h3>\n<p style=\"text-align: justify;\"><strong>Tri\u1ec7u ch\u1ee9ng:<\/strong> Khi ch\u1ea1y ss l\u00fac server c\u00f3 qu\u00e1 nhi\u1ec1u traffic (ho\u1eb7c DDoS HTTP), h\u00e0ng ch\u1ee5c ngh\u00ecn d\u00f2ng \u0111\u1ed5 xu\u1ed1ng terminal li\u00ean t\u1ee5c g\u00e2y treo ph\u1ea7n m\u1ec1m SSH.<\/p>\n<p style=\"text-align: justify;\"><strong>C\u00e1ch x\u1eed l\u00fd:<\/strong> Kh\u00f4ng hi\u1ec3n th\u1ecb tr\u1ef1c ti\u1ebfp m\u00e0 d\u00f9ng <code>awk<\/code> k\u1ebft h\u1ee3p <code>sort<\/code> \u0111\u1ec3 nh\u00f3m v\u00e0 \u0111\u1ebfm s\u1ed1 l\u01b0\u1ee3ng k\u1ebft n\u1ed1i \u0111ang m\u1edf theo t\u1eebng \u0111\u1ecba ch\u1ec9 IP. L\u1ec7nh sau s\u1ebd in ra top 10 IP \u0111ang k\u1ebft n\u1ed1i nhi\u1ec1u nh\u1ea5t:<\/p>\n<pre><code class=\"language-bash\">ss -nt state established | awk '{print $5}' | sed 's\/:[^:]*$\/\/' | sort | uniq -c | sort -nr | head -n 10<\/code><\/pre>\n<div style=\"background-color: #f8fafc; border: 1.5px solid #E2E8F0; border-radius: 12px; padding: 30px; margin: 40px 0;\">\n<h2 style=\"color: #1e3a8a; font-size: 22px; font-weight: bold; margin-top: 0;\">C\u00e2u H\u1ecfi Th\u01b0\u1eddng G\u1eb7p v\u1ec1 l\u1ec7nh ss<\/h2>\n<h3 style=\"font-size: 18px; font-weight: bold; color: #334155;\">1. L\u1ec7nh ss l\u00e0 g\u00ec?<\/h3>\n<p style=\"text-align: justify; margin-bottom: 20px;\">L\u1ec7nh ss (socket statistics) l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 ph\u00e2n t\u00edch m\u1ea1ng tr\u00ean Linux d\u00f9ng \u0111\u1ec3 ki\u1ec3m tra chi ti\u1ebft c\u00e1c c\u1ed5ng m\u1ea1ng, tr\u1ea1ng th\u00e1i socket v\u00e0 lu\u1ed3ng d\u1eef li\u1ec7u k\u1ebft n\u1ed1i. L\u1ec7nh n\u00e0y giao ti\u1ebfp tr\u1ef1c ti\u1ebfp v\u1edbi kernel space, \u0111\u1ea3m b\u1ea3o d\u1eef li\u1ec7u ph\u1ea3n h\u1ed3i lu\u00f4n ch\u00ednh x\u00e1c theo th\u1eddi gian th\u1ef1c.<\/p>\n<h3 style=\"font-size: 18px; font-weight: bold; color: #334155;\">2. L\u1ec7nh ss kh\u00e1c g\u00ec netstat?<\/h3>\n<p style=\"text-align: justify; margin-bottom: 20px;\">C\u1ea3 hai c\u00f4ng c\u1ee5 \u0111\u1ec1u ki\u1ec3m tra port, nh\u01b0ng ss thu\u1ed9c b\u1ed9 iproute2 chu\u1ea9n m\u1edbi, truy v\u1ea5n t\u1ed1c \u0111\u1ed9 cao qua giao th\u1ee9c NETLINK. Trong khi \u0111\u00f3, netstat (thu\u1ed9c net-tools) \u0111\u00e3 l\u1ed7i th\u1eddi, \u0111\u1ecdc d\u1eef li\u1ec7u kh\u00e1 ch\u1eadm t\u1eeb file c\u1ea5u h\u00ecnh t\u0129nh h\u1ec7 th\u1ed1ng, d\u1ec5 g\u00e2y th\u1eaft n\u00fat c\u1ed5 chai CPU.<\/p>\n<h3 style=\"font-size: 18px; font-weight: bold; color: #334155;\">3. L\u1ec7nh ss -tuln c\u00f3 ngh\u0129a g\u00ec?<\/h3>\n<p style=\"text-align: justify; margin-bottom: 20px;\">Tham s\u1ed1 <code>-tuln<\/code> bao g\u1ed3m c\u1edd TCP (-t), UDP (-u), l\u1eafng nghe Listen (-l) v\u00e0 d\u1ea1ng s\u1ed1 Numeric (-n). Vi\u1ec7c gh\u00e9p c\u00e1c c\u1edd n\u00e0y gi\u00fap sysadmin tra c\u1ee9u danh s\u00e1ch to\u00e0n b\u1ed9 c\u1ed5ng m\u1ea1ng \u0111ang m\u1edf tr\u00ean h\u1ec7 th\u1ed1ng d\u01b0\u1edbi d\u1ea1ng \u0111\u1ecbnh d\u1ea1ng s\u1ed1 nguy\u00ean, ng\u0103n ng\u1eeba th\u1eddi gian ch\u1edd ph\u00e2n gi\u1ea3i DNS.<\/p>\n<h3 style=\"font-size: 18px; font-weight: bold; color: #334155;\">4. C\u00e1ch t\u00ecm process \u0111ang ch\u1ea1y tr\u00ean m\u1ed9t port b\u1eb1ng ss?<\/h3>\n<p style=\"text-align: justify; margin-bottom: 20px;\">\u0110\u1ec3 x\u00e1c \u0111\u1ecbnh process ID \u0111ang chi\u1ebfm c\u1ed5ng m\u1ea1ng, b\u1ea1n ph\u1ea3i d\u00f9ng c\u1edd <code>-p<\/code> k\u00e8m \u0111\u1eb7c quy\u1ec1n cao nh\u1ea5t. C\u00fa ph\u00e1p th\u1ef1c thi: <code>sudo ss -tulnp | grep :80<\/code>. H\u1ec7 th\u1ed1ng s\u1ebd tr\u00edch xu\u1ea5t c\u1ed9t cu\u1ed1i c\u00f9ng ch\u1ee9a t\u00ean ti\u1ebfn tr\u00ecnh v\u00e0 ID quy chi\u1ebfu.<\/p>\n<h3 style=\"font-size: 18px; font-weight: bold; color: #334155;\">5. C\u00f3 c\u1ea7n quy\u1ec1n root \u0111\u1ec3 ch\u1ea1y l\u1ec7nh ss kh\u00f4ng?<\/h3>\n<p style=\"text-align: justify; margin-bottom: 0;\">Ng\u01b0\u1eddi d\u00f9ng b\u00ecnh th\u01b0\u1eddng v\u1eabn c\u00f3 th\u1ec3 g\u1ecdi l\u1ec7nh ss \u0111\u1ec3 th\u1ed1ng k\u00ea k\u1ebft n\u1ed1i c\u00e1 nh\u00e2n. Nh\u01b0ng \u0111\u1ec3 tra c\u1ee9u ch\u00e9o process ID do h\u1ec7 th\u1ed1ng s\u1edf h\u1eefu ho\u1eb7c do user kh\u00e1c t\u1ea1o ra qua c\u1edd <code>-p<\/code>, b\u1ea1n b\u1eaft bu\u1ed9c ph\u1ea3i c\u00f3 ph\u00e2n quy\u1ec1n sudo ho\u1eb7c ch\u1ea1y tr\u1ef1c ti\u1ebfp tr\u00ean t\u00e0i kho\u1ea3n root.<\/p>\n<\/div>\n<div style=\"border-top: 2px dashed #BFDBFE; margin-top: 50px; padding-top: 30px;\">\n<p style=\"text-align: justify;\">Trong m\u00f4i tr\u01b0\u1eddng Linux hi\u1ec7n \u0111\u1ea1i, s\u1eed d\u1ee5ng th\u00e0nh th\u1ea1o l\u1ec7nh ss l\u00e0 k\u1ef9 n\u0103ng kh\u00f4ng th\u1ec3 thi\u1ebfu \u0111\u1ec3 ch\u1ea9n \u0111o\u00e1n ch\u00ednh x\u00e1c t\u00ecnh tr\u1ea1ng m\u1ea1ng v\u00e0 b\u1ea3o v\u1ec7 h\u1ea1 t\u1ea7ng m\u00e1y ch\u1ee7. T\u1ed1c \u0111\u1ed9 \u0111\u1ecdc tr\u1ef1c ti\u1ebfp t\u1eeb kernel v\u00e0 kh\u1ea3 n\u0103ng l\u1ecdc s\u00e2u theo tr\u1ea1ng th\u00e1i TCP gi\u00fap c\u00f4ng c\u1ee5 n\u00e0y v\u01b0\u1ee3t tr\u1ed9i ho\u00e0n to\u00e0n so v\u1edbi netstat truy\u1ec1n th\u1ed1ng.<\/p>\n<p style=\"text-align: justify;\">Ngay l\u00fac n\u00e0y, h\u00e3y m\u1edf terminal k\u1ebft n\u1ed1i v\u00e0o VPS c\u1ee7a b\u1ea1n, th\u1ef1c h\u00e0nh chu\u1ed7i c\u1edd <code>ss -tulnp<\/code> \u0111\u1ec3 r\u00e0 so\u00e1t to\u00e0n b\u1ed9 c\u00e1c port \u0111ang m\u1edf v\u00e0 \u00e1p d\u1ee5ng ngay c\u00e1c gi\u1ea3i ph\u00e1p firewall ng\u0103n ng\u1eeba r\u1ee7i ro r\u00f2 r\u1ec9 d\u1eef li\u1ec7u.<\/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;\"><em>N\u1ed9i dung mang t\u00ednh tham kh\u1ea3o. L\u1ec7nh, c\u00fa ph\u00e1p, \u0111\u01b0\u1eddng d\u1eabn file v\u00e0 t\u00f9y ch\u1ecdn c\u1ea5u h\u00ecnh c\u00f3 th\u1ec3 thay \u0111\u1ed5i theo phi\u00ean b\u1ea3n h\u1ec7 \u0111i\u1ec1u h\u00e0nh, phi\u00ean b\u1ea3n ph\u1ea7n m\u1ec1m v\u00e0 m\u00f4i tr\u01b0\u1eddng c\u1ee5 th\u1ec3. N\u00ean ki\u1ec3m th\u1eed, sao l\u01b0u d\u1eef li\u1ec7u v\u00e0 \u0111\u00e1nh gi\u00e1 r\u1ee7i ro tr\u01b0\u1edbc khi \u00e1p d\u1ee5ng l\u00ean server production.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>L\u1ec7nh ss l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 d\u00f2ng l\u1ec7nh m\u1ea1nh m\u1ebd thu\u1ed9c g\u00f3i iproute2, \u0111\u01b0\u1ee3c thi\u1ebft k\u1ebf chuy\u00ean bi\u1ec7t \u0111\u1ec3 hi\u1ec3n th\u1ecb chi ti\u1ebft c\u00e1c k\u1ebft n\u1ed1i m\u1ea1ng, socket v\u00e0 ki\u1ec3m tra port \u0111ang m\u1edf. Nh\u1edd c\u01a1 ch\u1ebf giao ti\u1ebfp tr\u1ef1c ti\u1ebfp v\u1edbi kernel, l\u1ec7nh ss \u0111em l\u1ea1i t\u1ed1c \u0111\u1ed9 truy v\u1ea5n truy xu\u1ea5t th\u00f4ng tin<\/p>\n","protected":false},"author":2,"featured_media":43850,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[165],"tags":[],"class_list":["post-43845","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-kien-thuc-it"],"_links":{"self":[{"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/posts\/43845","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=43845"}],"version-history":[{"count":5,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/posts\/43845\/revisions"}],"predecessor-version":[{"id":43856,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/posts\/43845\/revisions\/43856"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/media\/43850"}],"wp:attachment":[{"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/media?parent=43845"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/categories?post=43845"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/tags?post=43845"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}