[CentOS] can't list directories in ftp

Sat Aug 13 17:56:55 UTC 2011
Tim Dunphy <bluethundr at jokefire.com>

Hello again, Barry

Yes interestingly enough that seemed to do it for the local test. This is odd, because I remember setting up another ProFTPd server with this directive and never ran into this issue. 

 Nevertheless, once I commented out the MasqueradeAddress directive it works locally.

[root at LCENT05:~] #/usr/bin/ftp localhost
Connected to localhost (127.0.0.1).
220 FTP Server ready.
Name (localhost:root): bluethundr
331 Password required for bluethundr
Password:
230 User bluethundr logged in
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
227 Entering Passive Mode (127,0,0,1,253,20).
150 Opening ASCII mode data connection for file list
-rw-r--r--   1 apache   apache      36834 Mar 11  2010 Copying
-rw-r--r--   1 apache   apache        266 Jul  9 10:30 How to install Piwik.html
-rw-r--r--   1 root     apache    1189469 Dec 20  2010 Illustration.ai
-rw-r--r--   1 root     apache     236524 Dec 20  2010 Illustration.jpg
-rw-r--r--   1 root     apache     230915 Dec 20  2010 Illustration.pdf
-rw-r--r--   1 root     apache    1206524 Dec 20  2010 Illustration_path.ai
-rw-r--r--   1 root     apache    2176338 Dec 20  2010 Illustration_path.eps

Which is nice! But when I try to connect remotely this is what occurs:

Response:	230 User bluethundr logged in
Command:	OPTS UTF8 ON
Response:	200 UTF8 set to on
Status:	Connected
Status:	Retrieving directory listing...
Command:	PWD
Response:	257 "/" is the current directory
Command:	TYPE I
Response:	200 Type set to I
Command:	PASV
Response:	227 Entering Passive Mode (192,168,1,48,251,255).
Status:	Server sent passive reply with unroutable address. Using server address instead.
Command:	MLSD
Error:	Connection timed out
Error:	Failed to retrieve directory listing

So remotely it's still having difficulty listing the directory. Here's a snippet from the logs. I've included a longer section of the logs in case this sheds any light on the issue. :) 

Seriously thanks for your help here, it's greatly appreciated!

Aug 13 12:45:44 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): USER bluethundr: Login successful.
Aug 13 12:45:44 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching PRE_CMD command 'OPTS UTF8 ON' to mod_tls
Aug 13 12:45:44 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching PRE_CMD command 'OPTS UTF8 ON' to mod_core
Aug 13 12:45:44 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching PRE_CMD command 'OPTS UTF8 ON' to mod_core
Aug 13 12:45:44 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching CMD command 'OPTS UTF8 ON' to mod_core
Aug 13 12:45:44 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching PRE_CMD command 'OPTS_UTF8 ON' to mod_tls
Aug 13 12:45:44 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching PRE_CMD command 'OPTS_UTF8 ON' to mod_core
Aug 13 12:45:44 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching PRE_CMD command 'OPTS_UTF8 ON' to mod_core
Aug 13 12:45:44 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching CMD command 'OPTS_UTF8 ON' to mod_lang
Aug 13 12:45:44 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching LOG_CMD command 'OPTS_UTF8 ON' to mod_log
Aug 13 12:45:44 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching LOG_CMD command 'OPTS UTF8 ON' to mod_log
Aug 13 12:45:45 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching PRE_CMD command 'PWD' to mod_tls
Aug 13 12:45:45 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching PRE_CMD command 'PWD' to mod_core
Aug 13 12:45:45 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching PRE_CMD command 'PWD' to mod_core
Aug 13 12:45:45 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching CMD command 'PWD' to mod_core
Aug 13 12:45:45 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): in dir_check_full(): path = '/', fullpath = '/'.
Aug 13 12:45:45 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching LOG_CMD command 'PWD' to mod_log
Aug 13 12:45:45 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching PRE_CMD command 'TYPE I' to mod_tls
Aug 13 12:45:45 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching PRE_CMD command 'TYPE I' to mod_core
Aug 13 12:45:45 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching PRE_CMD command 'TYPE I' to mod_core
Aug 13 12:45:45 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching CMD command 'TYPE I' to mod_xfer
Aug 13 12:45:45 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching LOG_CMD command 'TYPE I' to mod_log
Aug 13 12:45:45 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching PRE_CMD command 'PASV' to mod_tls
Aug 13 12:45:45 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching PRE_CMD command 'PASV' to mod_core
Aug 13 12:45:45 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching PRE_CMD command 'PASV' to mod_core
Aug 13 12:45:45 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching CMD command 'PASV' to mod_core
Aug 13 12:45:45 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): in dir_check_full(): path = '/', fullpath = '/'.
Aug 13 12:45:45 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): Entering Passive Mode (192,168,1,48,255,131).
Aug 13 12:45:45 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching LOG_CMD command 'PASV' to mod_log
Aug 13 12:45:45 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching PRE_CMD command 'MLSD' to mod_tls
Aug 13 12:45:45 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching PRE_CMD command 'MLSD' to mod_core
Aug 13 12:45:45 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching PRE_CMD command 'MLSD' to mod_core
Aug 13 12:45:45 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): dispatching CMD command 'MLSD' to mod_facts
Aug 13 12:45:45 LCENT05 proftpd[3095] 192.168.1.48 (xx.xxx.xxx.xxx[xx.xxx.xxx.xxx]): in dir_check_full(): path = '/', fullpath = '/'.


----- Original Message -----
From: "Barry Brimer" <lists at brimer.org>
To: "CentOS mailing list" <centos at centos.org>
Sent: Saturday, August 13, 2011 1:32:03 PM
Subject: Re: [CentOS] can't list directories in ftp

> Sorry for all the questions today. But I am trying to wrap up this ftp business and still having some issues. I appreciate your input.
>
> SELinux is temporarily disabled (until I can work this all out) and I am now able to log into the FTP server.

<snip>

> This is what my proftpd config is looking like at the moment.

<snip>

> # Masqurade Address
> MasqueradeAddress               xx.xxx.xxx.xxx

<snip>

I'm betting that your MasqueradeAddress is the issue.  This is great when 
you are behind a NATing firewall, but for localhost testing, it could be 
your issue.

Try commenting out your MasqueradeAddress line and it should create the 
connection back through the IP address you connected from instead of 
forcing the one in your MasqueradeAddress.  When you want to test the real 
setup, put it back in.

Barry
_______________________________________________
CentOS mailing list
CentOS at centos.org
http://lists.centos.org/mailman/listinfo/centos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: proftpd.conf
Type: application/octet-stream
Size: 10134 bytes
Desc: not available
URL: <http://lists.centos.org/pipermail/centos/attachments/20110813/ea94bf70/attachment-0005.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: proftpd.log
Type: text/x-log
Size: 14720 bytes
Desc: not available
URL: <http://lists.centos.org/pipermail/centos/attachments/20110813/ea94bf70/attachment-0005.bin>