从源辞典

查阅生活点点滴滴

Slow FTP Upload

August 15th, 2005 by congyuan

The server pauses for every file uploaded.

Server software: Proftpd

Rosolved:

Edit proftpd.conf file:
vi /etc/proftpd.conf

Add the following lines after default server:
UseReverseDNS off
IdentLookups off

Restart proftpd:
service proftpd restart

Posted in 电脑网络, FTP Server, Linux | No Comments »

FTP connection problem

August 15th, 2005 by congyuan

http://forum.ensim.com/showthread.php?t=5082
By chinkshady

For FTP issues from behind NAT or broadband connections

If you are on a broadband connection, it is likely you have NAT/non-routable IP address settings either on your internal network or from your connection provider. If you see IP ranges in the 10.x.x.x or 192.168.x.x range when you run traceroutes from your computer to an outside domain like www.yahoo.com, you are effected by this. You may also be effected if your connection is on a software or hardware firewall.

The symptoms while FTPing appear as directories not listing out, slow FTP connections, and file transfer issues.

FTP uses 2 TCP connections, 1 for control and one for data.
The standard control connection is TCP port 21. The control part that is rarely seen is TCP port 20.

When an FTP connection is made but listing a directory or sending data fails, the cause is almost ALWAYS the data connection. This is the most common problem encountered in FTP connections.

FTP also runs in 2 modes, PORT (”regular” or “normal” mode) and pasv (”passive” mode for clients behind firewalls)

In PORT mode, the FTP Client is the server end of the data connection.
In pasv mode, the server is the Web Server end of the data connection.

Looking at the FTP logs you may see the following

FTP Client> PORT 12,34,56,78,65,49
Web Server> 200 PORT command successful.

In this example of PORT mode the client has said it will be listening on IP address 12.34.56.78 on TCP port 16683 for the data channel.
The port is the 65,49 pair at the end of the string: 65×256 + 49 = 16689.
The FTP Client is the server for the data connection so if that FTP Client is behind a NAT, port 16683 MUST be allowed.

FTP Client> pasv
Web Server> 227 Entering Passive Mode (123,45,67,89,158,25)

In this example of pasv mode the server has said it will be listening on IP address 123.45.67.89 on TCP port 40474 for the data channel.
The port is the 158,25 pair at the end of the string:: 158×256 + 25 = 40473.
The Web Server needs to allow this data connection on port 40473 as well as the control port 20.

To overcome this issue, try setting up the connection as PORT connection instead of pasv. You may also have to use a different FTP Client.

FTP Clients that can do PORT mode from behind a NAT or firewalled connection or bypass non-routable IPs are:
FlashFXP
BulletProof FTP

Posted in FTP Server | No Comments »

困扰很久的在Linux下FTP问题

June 1st, 2005 by congyuan

经常发现有的网站的FTP不能连接上,可以登陆,但是总是停在某个地方.如用gFTP:

220---------- Welcome to Pure-FTPd [TLS] ----------
220-You are user number 2 of 250 allowed.
220-Local time is now 01:16. Server port: 21.
220 You will be disconnected after 4 minutes of inactivity.
USER xxxxx
331 User xxxxx OK. Password required
PASS xxxx
230-User xxxxx has group access to:  xxxxx
230 OK. Current restricted directory is /
TYPE I
200 TYPE is now 8-bit binary
CWD /
250 OK. Current directory is /
PASV
227 Entering Passive Mode (66,29,3,66,231,25)
LIST

就停在上面一行.

试过disable Passive Mode,结果是一样.如下:

220---------- Welcome to Pure-FTPd [TLS] ----------
220-You are user number 1 of 250 allowed.
220-Local time is now 01:20. Server port: 21.
220 You will be disconnected after 4 minutes of inactivity.
USER xxxxxx
331 User xxxxx OK. Password required
PASS xxxx
230-User xxxxxx has group access to:  xxxxxx
230 OK. Current restricted directory is /
TYPE I
200 TYPE is now 8-bit binary
PWD
257 "/" is your current location
PORT 192,168,42,77,157,42

试过别的如ncFTP, 还有Linux的ftp command,都是同样的结果.

同一个网络,用windows的WS_FTP就没有问题.Log file如下:

220---------- Welcome to Pure-FTPd [TLS] ----------
220-You are user number 2 of 250 allowed.
220-Local time is now 01:22. Server port: 21.
220 You will be disconnected after 4 minutes of inactivity.
USER xxxxxx
331 User xxxxxx OK. Password required
PASS (hidden)
230-User xxxxxx has group access to:  xxxxxx
230 OK. Current restricted directory is /
PWD
257 "/" is your current location
Host type (I): UNIX (standard)
PORT 192,168,42,17,4,196
200 PORT command successful
LIST
150 Connecting to port 61682
Received 1471 bytes in 0.1 secs, (140.00 Kbps),
transfer succeeded
226-Options: -a -l
226 22 matches total

以上是没有使用Passive Mode.即时是enable Passive Mode, windows下也没有类似的问题.

Posted in FTP Server | No Comments »