Some time ago configured pureftp upload program, but the period of all sorts of people uncomfortable problem! For example, when using flashftp locally, the most "data Socket error Connection timed out" error, whether using active or passive mode upload, there will be similar errors!
[Right] Data Socket error: No channel to host
[Right] List error
[Right] PASV
[Right] entering passive Mode (116,255,246,176,83,197)
[Right] Opening data connection ip:116.255.246.176 port: 21445
[Right] Data Socket error: Connection timed out
[Right] List error
[Right] failed to connect in PASV mode and is attempting to use PORT mode.
[Right] listens on port: 4447, waiting for connection.
[Right] PORT 192,168,1,222,17,95
[Right] 500 I can't open the connection to 129.79.76.201 (125.40.55.15 only)
[Right] List error
[Right] quit because the time is tight, has been no meditation, today suddenly figured out, may be CentOS firewall rules, because FTP can connect to the host, but can not display the list!
Then look at the firewall rules: # vi/etc/sysconfig/iptables, which about FTP has the following two:
The code is as follows |
Copy Code |
-A input-p tcp-m state--state new-m TCP--dport 20-j ACCEPT -A input-p tcp-m state--state new-m TCP--dport 21-j ACCEPT |
Should not be wrong, and looked up the error message, found that the passive mode of the port is always unable to connect, a flash, view the pureftp configuration file in the passive mode port number segment:
The code is as follows |
Copy Code |
# vi/usr/local/pureftpd/pure-ftpd.conf PassivePortRange 10000 20000 in |
It was a iptables riga:
The code is as follows |
Copy Code |
-A input-m state--state new-m tcp-p TCP--dport 10000:20000-j ACCEPT |
Then save the firewall rules and restart the firewall, again using FLASHFTP, all normal!!
Summary: The problem is small problem, the solution is also simple, the key is careful! Careful!