Link to home
Start Free TrialLog in
Avatar of abalonia
abaloniaFlag for United States of America

asked on

FTP could not read reply from control connection

I set up an anonymous vsftpd server on a system running Red Hat Enterprise Linux AS release 4. When I connect to the FTP server with a command-line client or a browser, I can change directories and list the files with their timestamps and sizes, but when I try to download a file, I get this error message:

"Could not read reply from control connection -- timed out.
get README: timed out while waiting for server response."

This happens for any file I try to download. vsftpd is running as a stand-alone program, not using inetd. I tried
commenting out connect_from_port_20 in the config file, but I got the same error. I've attached my vsftpd.conf file, adding a .txt extension so that Experts Exchange will alllow it.
vsftpd.conf.txt
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

This could be a firewall issue. Do you have ports 20 and 21 tcp open?
Avatar of abalonia

ASKER

Yes, the firewall is accepting packets to ports 20 and 21.
What about iptables ?
Iptables is the firewall. The server is not behind a hardware firewall.
Iptables has these two rules:

ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:21
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:20
What about the permissions on the remote file or dir?
The file on the FTP server is like /misc/ftp/pub/README. /misc/ftp, /misc/ftp/pub, and the README file are all world-readable, and the directories are world-executable. /misc/ftp is NFS mounted from another server.
When I set vsftpd to look at /var/ftp instead, downloading files worked. But when I mounted the NFS share on /var/ftp/pub, downloading files resulted in the same error. It seems that vsftpd doesn't like NFS, even when the permissions are all world-readable and executable.
What perms are set on the NFS share and who is the owner of the files / folders?

Under what user id your vsftpd runs?
The main vsftpd process runs as root. When I connect from an FTP client, a child process starts that runs as "nobody", and another child process starts as "ftp". The NFS share belongs to another local user and is set to world-readable permissions. A local directory that belongs to the same user is served out successfulyy by vsftpd.
ASKER CERTIFIED SOLUTION
Avatar of abalonia
abalonia
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial