{"id":3761,"date":"2020-01-03T16:20:37","date_gmt":"2020-01-03T09:20:37","guid":{"rendered":"https:\/\/tino.vn\/?post_type=ht_kb&#038;p=3761"},"modified":"2020-01-03T16:20:37","modified_gmt":"2020-01-03T09:20:37","slug":"1-so-cau-lenh-thuong-su-dung-tren-csf-ssh-command-line-commands-csf-cheat-sheet","status":"publish","type":"ht_kb","link":"https:\/\/tino.vn\/blog\/docs\/1-so-cau-lenh-thuong-su-dung-tren-csf-ssh-command-line-commands-csf-cheat-sheet\/","title":{"rendered":"1 s\u1ed1 c\u00e2u l\u1ec7nh th\u01b0\u1eddng s\u1eed d\u1ee5ng tr\u00ean CSF SSH Command Line Commands (CSF Cheat Sheet)"},"content":{"rendered":"<p>B\u00e0i vi\u1ebft n\u00e0y tr\u00ecnh b\u00e0y m\u1ed9t s\u1ed1 l\u1ec7nh d\u00f2ng l\u1ec7nh SSH c\u1ea5u h\u00ecnh m\u00e1y ch\u1ee7 c\u1ea5u h\u00ecnh (CSF) h\u1eefu \u00edch.<\/p>\n<table class=\"wrapped relative-table confluenceTable\">\n<tbody>\n<tr>\n<th class=\"confluenceTh\" align=\"left\">Command<\/th>\n<th class=\"confluenceTh\" align=\"left\">Description<\/th>\n<th class=\"confluenceTh\" align=\"left\">Example<\/th>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\" colspan=\"1\">csf -e<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">Enable CSF (B\u1eadt CSF)<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">root@server[~]#csf -e<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\" colspan=\"1\">csf -x<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">Disable CSF (T\u1eaft CSF)<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">root@server[~]#csf -x<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">csf -s<\/td>\n<td class=\"confluenceTd\"><em>Start the firewall rules (B\u1eaft \u0111\u1ea7u c\u00e1c quy t\u1eafc t\u01b0\u1eddng l\u1eeda)<\/em><\/td>\n<td class=\"confluenceTd\">root@server[~]#csf -s<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">csf -f<\/td>\n<td class=\"confluenceTd\"><em>Flush\/Stop firewall rules (note: lfd may restart csf)<br \/>\n<\/em><\/td>\n<td class=\"confluenceTd\">root@server[~]#csf -f<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">csf -r<\/td>\n<td class=\"confluenceTd\"><em>Restart the firewall rules (Kh\u1edfi \u0111\u1ed9ng l\u1ea1i t\u01b0\u1eddng l\u1eeda)<\/em><\/td>\n<td class=\"confluenceTd\">root@server[~]#csf -r<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">csf -a [IP.add.re.ss]\u00a0[Optional comment]<\/td>\n<td class=\"confluenceTd\"><em>Allow an IP and add to \/etc\/csf\/csf.allow (Cho ph\u00e9p 1 IP kh\u1ecfi t\u01b0\u1eddng l\u1eeda)<br \/>\n<\/em><\/td>\n<td class=\"confluenceTd\">root@server[~]#csf -a 187.33.3.3 Home IP Address<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\" colspan=\"1\">csf -td [IP.add.re.ss] [Optional comment]<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">Place an IP on the temporary deny list in \/var\/lib\/csf\/csf.tempban (\u0110\u1eb7t m\u1ed9t IP v\u00e0o danh s\u00e1ch t\u1eeb ch\u1ed1i t\u1ea1m th\u1eddi)<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">root@server[~]#csf -td 55.55.55.55 Odd traffic patterns<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">csf -tr [IP.add.re.ss]<\/td>\n<td class=\"confluenceTd\"><em>Remove an IP from the temporary IP ban or allow list. (X\u00f3a IP kh\u1ecfi l\u1ec7nh c\u1ea5m t\u1ea1m th\u1eddi ho\u1eb7c danh s\u00e1ch cho ph\u00e9p)<br \/>\n<\/em><\/td>\n<td class=\"confluenceTd\">root@server[~]#csf -tr 66.192.23.1<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">csf -tf<\/td>\n<td class=\"confluenceTd\"><em>Flush all IPs from the temporary IP entries (X\u00f3a t\u1ea5t c\u1ea3 IP t\u1eeb c\u00e1c m\u1ee5c IP t\u1ea1m th\u1eddi)<br \/>\n<\/em><\/td>\n<td class=\"confluenceTd\">root@server[~]#csf -tf<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">csf -d [IP.add.re.ss]\u00a0[Optional comment]<\/td>\n<td class=\"confluenceTd\"><em>Deny an IP and add to \/etc\/csf\/csf.deny (T\u1eeb ch\u1ed1i m\u1ed9t IP v\u00e0 th\u00eam v\u00e0o \/etc\/csf\/csf.deny)<\/em><\/td>\n<td class=\"confluenceTd\">root@server[~]#csf -d 66.192.23.1 Blocked This Guy<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">csf -dr [IP.add.re.ss]<\/td>\n<td class=\"confluenceTd\"><em>Unblock an IP and remove from \/etc\/csf\/csf.deny (B\u1ecf ch\u1eb7n m\u1ed9t IP v\u00e0 x\u00f3a kh\u1ecfi \/etc\/csf\/csf.deny)<\/em><\/td>\n<td class=\"confluenceTd\">root@server[~]#csf -dr 66.192.23.1<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">csf -df<\/td>\n<td class=\"confluenceTd\"><em>Remove and unblock all entries in \/etc\/csf\/csf.deny (X\u00f3a v\u00e0 b\u1ecf ch\u1eb7n t\u1ea5t c\u1ea3 c\u00e1c m\u1ee5c)<\/em><\/td>\n<td class=\"confluenceTd\">root@server[~]#csf -df<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">csf -g [IP.add.re.ss]<\/td>\n<td class=\"confluenceTd\"><em>Search the iptables and ip6tables rules for a match (e.g. IP, CIDR, Port Number)<\/em><\/td>\n<td class=\"confluenceTd\">root@server[~]#csf -g 66.192.23.1<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">csf -t<\/td>\n<td class=\"confluenceTd\">\u00a0Displays the current list of temporary allow and deny IP entries with their TTL and comments<\/td>\n<td class=\"confluenceTd\">\u00a0root@server[~]#csf -t<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Ch\u00fac c\u00e1c b\u1ea1n th\u00e0nh c\u00f4ng.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>B\u00e0i vi\u1ebft n\u00e0y tr\u00ecnh b\u00e0y m\u1ed9t s\u1ed1 l\u1ec7nh d\u00f2ng l\u1ec7nh SSH c\u1ea5u h\u00ecnh m\u00e1y ch\u1ee7 c\u1ea5u h\u00ecnh (CSF) h\u1eefu \u00edch. Command Description Example csf -e Enable CSF (B\u1eadt CSF) root@server[~]#csf -e csf -x Disable CSF (T\u1eaft CSF) root@server[~]#csf -x csf -s Start the firewall rules (B\u1eaft \u0111\u1ea7u c\u00e1c quy t\u1eafc t\u01b0\u1eddng l\u1eeda) root@server[~]#csf -s csf [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":16424,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"tags":[],"ht_kb_category":[17],"class_list":["post-3761","ht_kb","type-ht_kb","status-publish","format-standard","has-post-thumbnail","hentry","ht_kb_category-huong-dan-ve-cloud-vps"],"_links":{"self":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb\/3761","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb"}],"about":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/comments?post=3761"}],"version-history":[{"count":0,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb\/3761\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/media\/16424"}],"wp:attachment":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/media?parent=3761"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/tags?post=3761"},{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb_category?post=3761"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}