{"id":785,"date":"2018-10-19T07:34:06","date_gmt":"2018-10-19T07:34:06","guid":{"rendered":"http:\/\/hyderabadwebhosting.in\/blog\/?p=785"},"modified":"2018-10-28T07:45:14","modified_gmt":"2018-10-28T07:45:14","slug":"block-ftp-access-using-csf-firewall","status":"publish","type":"post","link":"https:\/\/hyderabadwebhosting.in\/blog\/block-ftp-access-using-csf-firewall\/","title":{"rendered":"Block FTP access using csf firewall"},"content":{"rendered":"<p><span style=\"font-size: large;\">To completely disable the FTP access on the server follow the below steps:<\/span><\/p>\n<pre class=\"lang:default decode:true\">root@server[#] vi \/etc\/csf\/csf.conf<\/pre>\n<p><span style=\"font-size: large;\">Search for the lines:<\/span><\/p>\n<p><span style=\"font-size: large;\"># Allow incoming TCP ports<\/span><\/p>\n<p><span style=\"font-size: large;\">TCP_IN =<\/span><\/p>\n<p><span style=\"font-size: large;\">and remove the port 21 from the list<\/span><\/p>\n<p><span style=\"font-size: large;\">Save and quit.<\/span><\/p>\n<p><span style=\"font-size: large;\">And then restart the CSF firewall using the below command:<\/span><\/p>\n<pre class=\"lang:default decode:true\">root@server[#] csf -r<\/pre>\n<p><span style=\"font-size: large;\">If you want to block FTP access for a Specific IP then follow the below steps:<\/span><\/p>\n<pre class=\"lang:default decode:true\">root@server[#] vi \/etc\/csf\/csf.deny<\/pre>\n<p><span style=\"font-size: large;\">and add the line :<\/span><\/p>\n<p><span style=\"font-size: large;\">tcp:in:d=21:s=10.10.10.10<\/span><\/p>\n<p><span style=\"font-size: large;\">save and quit<\/span><\/p>\n<p><span style=\"font-size: large;\">And then restart CSF firewall using the below command:<\/span><\/p>\n<pre class=\"lang:default decode:true\">root@server[#] csf -r<\/pre>\n<p><span style=\"font-size: large;\">If you want to allow FTP access for only one ip on the server and denied for all other IPS<\/span><\/p>\n<pre class=\"lang:default decode:true\">root@server[#] vi \/etc\/csf\/csf.conf<\/pre>\n<p><span style=\"font-size: large;\">Then search for the line:<\/span><\/p>\n<p><span style=\"font-size: large;\"># Allow incoming TCP ports<\/span><\/p>\n<p><span style=\"font-size: large;\">and the remove the ports : 21 and 22<\/span><\/p>\n<p><span style=\"font-size: large;\">also search for the line :<\/span><\/p>\n<p><span style=\"font-size: large;\"># Allow outgoing TCP ports<\/span><\/p>\n<p><span style=\"font-size: large;\">and remove the ports: 21 and 22<\/span><\/p>\n<p><span style=\"font-size: large;\">Save and quit<\/span><\/p>\n<p><span style=\"font-size: large;\">Then open the csf.allow file<\/span><\/p>\n<pre class=\"lang:default decode:true\">root@server[#] vi \/etc\/csf\/csf.allow<\/pre>\n<p><span style=\"font-size: large;\">and add the entry as :<\/span><\/p>\n<p><span style=\"font-size: large;\">tcp:in:d=21:s=10.10.10.10<\/span><\/p>\n<p><span style=\"font-size: large;\">Save and Quit.<\/span><\/p>\n<p><span style=\"font-size: large;\">And then restart the CSF service<\/span><\/p>\n<pre class=\"lang:default decode:true\">root@server[#] csf -r<\/pre>\n<p><span style=\"font-size: large;\">Note: Replace the IP 10.10.10.10 with the Actual IP.<\/span><\/p>\n<div class=\"pdf24Plugin-cp\"> \t<form name=\"pdf24Form0\" method=\"post\" action=\"https:\/\/doc2pdf.pdf24.org\/wordpress.php\" target=\"pdf24PopWin\" onsubmit=\"var pdf24Win = window.open('about:blank', 'pdf24PopWin', 'resizable=yes,scrollbars=yes,width=600,height=250,left='+(screen.width\/2-300)+',top='+(screen.height\/3-125)+''); pdf24Win.focus(); if(typeof pdf24OnCreatePDF === 'function'){void(pdf24OnCreatePDF(this,pdf24Win));}\"> \t\t<input type=\"hidden\" name=\"blogCharset\" value=\"Cw1x07UAAA==\" \/><input type=\"hidden\" name=\"blogPosts\" value=\"MwQA\" \/><input type=\"hidden\" name=\"blogUrl\" value=\"yygpKSi20tfPqExJLUpMSkwpT03KyC8uycxL18vM00\/KyU8HAA==\" \/><input type=\"hidden\" name=\"blogName\" value=\"86hMSS1KTEpMUQhPTVLwyC8uycxLBwA=\" \/><input type=\"hidden\" name=\"blogValueEncoding\" value=\"gzdeflate base64\" \/><input type=\"hidden\" name=\"postId_0\" value=\"M7cwBQA=\" \/><input type=\"hidden\" name=\"postTitle_0\" value=\"c8rJT85WcAsJUEhMTk4tLlYoLc7MS1dILk5TSMssSi1PzMkBAA==\" \/><input type=\"hidden\" name=\"postLink_0\" value=\"FckxDsAgCADAF1H2\/gYQldSoERrT37ddbrkaMf1ErE\/SRUxpK9fhYb0c1pHbKD9yQY4JJKLucPvXIJ4h29JNreEL\" \/><input type=\"hidden\" name=\"postAuthor_0\" value=\"c\/QLDVAICHJ08XD0AwA=\" \/><input type=\"hidden\" name=\"postDateTime_0\" value=\"MzIwtNA1NNA1tFQwMLcyNLAyMAMA\" \/><input type=\"hidden\" name=\"postContent_0\" value=\"1ZVBj9owEIXv\/RUj9rxQOKYBFa20EpcVbbhVVWWcCVg1HtfjgNJf33HSbimttBtYLaoEErHl53kzHy+5n+XslQOOjcXpoCIXb9l8xwysCht8N5itCDTtvMWItoHSsFpbhLhFuF8tQWmNzECuXWEMewxQkbV0aFfWmH5xRM9ZPkpXzfKRn73JfUDQVjFPB1a5TVZipWoboURNJWYx1DiYBaL4vhP9dPMZ9gZGGPVIc5W+Q02uErWASe9JIwWqoLdSXGgrs8bhaU1PatzAvLVmnPTEuA2s7pbgKUTuKSTnviweYNrzmHIlBNzRvptAuhkmY6gC7X6a4thTslAilnS\/1SYOex6eyzm510lRHJUUk4q4K+6hMgEPylqoObXpNwrSt53cdjkMAgDchuePf1FBQzUclJMqCdaW9NdjhBMXCgqP2lRGw2LZGXstlkt0zfPNpHmpsnwEGfqCHLXPjMvK6WSc8XT8dvjr01OHj+m5FJ7\/AhzV8nACDjnJRpI5GH+Shak3MluDZUeYOCPZDgJYceVAXKXe89+peLVQVB0QpwnHkKWQS7uTSV9Jy\/Qvj3CuSarjhi41eWrwfH\/FBf+\/dv7kseM18dOxXRmLL45mK31ewKGLoQHFVwu5xyZ\/eMlXZOqV0fjqefZAUZ4+ordKdwzKu+6oOXAwcduuz3WslZXtPzz\/AA==\" \/> \t\t<a href=\"https:\/\/www.pdf24.org\" target=\"_blank\" title=\"www.pdf24.org\"><img src=\"https:\/\/hyderabadwebhosting.in\/blog\/wp-content\/plugins\/pdf24-post-to-pdf\/img\/sheep_32x32.png\" alt=\"www.pdf24.org\" border=\"0\" height=\"32\" \/><\/a> \t\t<span class=\"pdf24Plugin-cp-space\">&nbsp;&nbsp;<\/span> \t\t<span class=\"pdf24Plugin-cp-text\">Send article as PDF<\/span> \t\t<span class=\"pdf24Plugin-cp-space\">&nbsp;&nbsp;<\/span> \t\t<input class=\"pdf24Plugin-cp-input\" style=\"margin: 0px;\" type=\"text\" name=\"sendEmailTo\" placeholder=\"Enter email address\" \/> \t\t<input class=\"pdf24Plugin-cp-submit\" style=\"margin: 0px;\" type=\"submit\" value=\"Send\" \/> \t<\/form> <\/div>","protected":false},"excerpt":{"rendered":"<p>To completely disable the FTP access on the server follow the below steps: root@server[#] vi \/etc\/csf\/csf.conf Search for the lines: # Allow incoming TCP ports TCP_IN = and remove the port 21 from the list Save and quit. And then restart the CSF firewall using the below command: root@server[#] csf -r If you want to\u2026 <span class=\"read-more\"><a href=\"https:\/\/hyderabadwebhosting.in\/blog\/block-ftp-access-using-csf-firewall\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":786,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","footnotes":""},"categories":[6],"tags":[],"class_list":["post-785","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vps"],"_links":{"self":[{"href":"https:\/\/hyderabadwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/785","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hyderabadwebhosting.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hyderabadwebhosting.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hyderabadwebhosting.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hyderabadwebhosting.in\/blog\/wp-json\/wp\/v2\/comments?post=785"}],"version-history":[{"count":1,"href":"https:\/\/hyderabadwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/785\/revisions"}],"predecessor-version":[{"id":787,"href":"https:\/\/hyderabadwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/785\/revisions\/787"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hyderabadwebhosting.in\/blog\/wp-json\/wp\/v2\/media\/786"}],"wp:attachment":[{"href":"https:\/\/hyderabadwebhosting.in\/blog\/wp-json\/wp\/v2\/media?parent=785"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hyderabadwebhosting.in\/blog\/wp-json\/wp\/v2\/categories?post=785"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hyderabadwebhosting.in\/blog\/wp-json\/wp\/v2\/tags?post=785"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}