{"id":918,"date":"2012-11-19T04:19:29","date_gmt":"2012-11-19T10:19:29","guid":{"rendered":"http:\/\/blog.supportpro.com\/?p=918"},"modified":"2026-06-22T00:20:52","modified_gmt":"2026-06-22T06:20:52","slug":"ftp-connection-issues-can-connect-via-console-but-not-with-filezila","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/ftp-connection-issues-can-connect-via-console-but-not-with-filezila\/","title":{"rendered":"How to Fix FTP Connection Issues in FileZilla While Console Login Works"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">Introduction<\/h1>\n\n\n\n<p>FTP is a popular protocol for transferring files between a local computer and a server. However, administrators may find that FTP authentication works fine via the command line, while FTP clients like FileZilla fail to display directory listings or complete file transfers.<\/p>\n\n\n\n<p>Usually, this problem relates to Passive Mode settings and firewall configurations. When passive FTP ports are blocked, the client can log in successfully but cannot establish the data connection required to list directories or transfer files.<\/p>\n\n\n\n<p>This article outlines the main cause of this issue and provides step-by-step instructions to fix it on a server running Pure-FTPd and CSF Firewall.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Issue<\/h2>\n\n\n\n<p>You can successfully connect to the FTP server using the command line, but when connecting through an FTP client like FileZilla:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The connection hangs at the <strong>MLSD command<\/strong><\/li>\n\n\n\n<li>Directory listing fails<\/li>\n\n\n\n<li>Connection eventually times out<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Cause<\/h2>\n\n\n\n<p>This issue usually occurs when the FTP server operates in <strong>Passive Mode<\/strong>.<\/p>\n\n\n\n<p>In passive mode:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The FTP client connects to <strong>port 21<\/strong> for authentication.<\/li>\n\n\n\n<li>The server then opens a <strong>random high port<\/strong> (typically above 30000) for data transfer.<\/li>\n\n\n\n<li>If these passive ports are blocked by the firewall, directory listing and file transfers will fail.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Solution<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Log in to the FTP Server<\/h3>\n\n\n\n<p>Access your server via SSH.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Configure Passive Port Range<\/h3>\n\n\n\n<p>Open the Pure-FTPd configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vi \/etc\/pure-ftpd.conf<\/code><\/pre>\n\n\n\n<p>Locate the following line:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">PassivePortRange 30000 35000<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ensure the line exists.<\/li>\n\n\n\n<li>Make sure it is <strong>not commented out<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p>Save the file after confirming the configuration.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Allow Passive Ports in CSF Firewall<\/h3>\n\n\n\n<p>Edit the CSF configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vi \/etc\/csf\/csf.conf<\/code><\/pre>\n\n\n\n<p>Find the <strong>TCP_IN<\/strong> rule and modify it as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>TCP_IN = \"20,21,22,25,53,80,110,30000:35000\"<\/code><\/pre>\n\n\n\n<p>This allows incoming connections for FTP passive data ports.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Restart CSF Firewall<\/h3>\n\n\n\n<p>After saving changes, restart CSF:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>csf -r<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Result<\/h2>\n\n\n\n<p>Once the passive port range is properly configured and allowed in CSF:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>FTP clients like FileZilla will connect successfully.<\/li>\n\n\n\n<li>MLSD timeout errors will be resolved.<\/li>\n\n\n\n<li>Directory listing and file transfers will work normally.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>When FTP login works from the command line but fails in FileZilla, the issue is usually due to passive FTP ports being blocked by the firewall. By configuring a passive port range in Pure-FTPd and allowing those ports through CSF, administrators can restore normal FTP functionality, such as directory listings and file transfers.<\/p>\n\n\n\n<p>Configuring passive mode correctly is crucial for dependable FTP connectivity. It also helps avoid common timeouts and connection issues that FTP clients often encounter.<\/p>\n\n\n\n<p>If you require help, <a href=\"https:\/\/www.supportpro.com\/requestquote.php\">contact SupportPRO Server Admin<\/a><span id=\"hs-cta-wrapper-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-wrapper\"><span id=\"hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-node hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\"><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b\"><\/a><\/span><\/span><\/p>\n\n\n\n<div class=\"wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile is-vertically-aligned-center has-white-background-color has-background\"><div class=\"wp-block-media-text__content\">\n<p class=\"has-large-font-size\">Facing issues? <\/p>\n\n\n\n<p class=\"has-large-font-size\">Our technical support<br>engineers can solve it. <\/p>\n\n\n\n<!--HubSpot Call-to-Action Code --><span class=\"hs-cta-wrapper\" id=\"hs-cta-wrapper-3350a795-db50-482f-9911-301930d1b1be\"><span class=\"hs-cta-node hs-cta-3350a795-db50-482f-9911-301930d1b1be\" id=\"hs-cta-3350a795-db50-482f-9911-301930d1b1be\"><!--[if lte IE 8]><div id=\"hs-cta-ie-element\"><\/div><![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/2725694\/3350a795-db50-482f-9911-301930d1b1be\" ><img class=\"hs-cta-img\" id=\"hs-cta-img-3350a795-db50-482f-9911-301930d1b1be\" style=\"border-width:0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/2725694\/3350a795-db50-482f-9911-301930d1b1be.png\"  alt=\"Contact Us today!\"\/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(2725694, '3350a795-db50-482f-9911-301930d1b1be', {\"useNewLoader\":\"true\",\"region\":\"na1\"}); <\/script><\/span><!-- end HubSpot Call-to-Action Code -->\n<\/div><figure class=\"wp-block-media-text__media\"><img width=\"904\" height=\"931\" src=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup.png\" alt=\"guy server checkup\" class=\"wp-image-12943 size-full\" srcset=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup.png 904w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-291x300.png 291w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-768x791.png 768w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-585x602.png 585w\" sizes=\"(max-width: 904px) 100vw, 904px\" \/><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Introduction FTP is a popular protocol for transferring files between a local computer and a server. However, administrators may find that FTP authentication works fine via the command line, while&hellip;<\/p>\n","protected":false},"author":4,"featured_media":17609,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":""},"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/918"}],"collection":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=918"}],"version-history":[{"count":8,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/918\/revisions"}],"predecessor-version":[{"id":17610,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/918\/revisions\/17610"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media\/17609"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=918"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=918"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=918"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}