CentOS under pureftp "Data Socket error Connection timed out" error resolution

Source: Internet
Author: User
Tags socket socket error centos iptables port number

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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.