I have an issue with file upload via FTP. I can successfuly list the directories, but when I try to upload a file, let's say ".htaccess", it hangs for about 20 seconds on STOR .htacess
, and then throws a timeout. It retries several times but always fails.
This is how a full output from FTP client looks like for file transfer:
Status: Connecting to 88.150.168.207:21...
Status: Connection established, waiting for welcome message...
Response: 220 Welcome to CodeBuster FTP service.
Command: USER codebuster
Response: 331 Please specify the password.
Command: PASS ********
Response: 230 Login successful.
Command: OPTS UTF8 ON
Response: 200 Always in UTF8 mode.
Status: Connected
Status: Starting upload of D:\Projects\codebuster\.htacess
Command: CWD /public_html
Response: 250 Directory successfully changed.
Command: PWD
Response: 257 "/public_html"
Command: TYPE A
Response: 200 Switching to ASCII mode.
Command: PASV
Response: 227 Entering Passive Mode (88,150,168,207,155,25).
Command: STOR .htacess
Error: Connection timed out
Error: File transfer failed
Status: Connecting to 88.150.168.207:21...
Status: Connection established, waiting for welcome message...
Response: 220 Welcome to CodeBuster FTP service.
Command: USER codebuster
Response: 331 Please specify the password.
Command: PASS ********
Response: 230 Login successful.
Command: OPTS UTF8 ON
Response: 200 Always in UTF8 mode.
Status: Connected
Status: Starting upload of D:\Projects\codebuster\.htacess
Command: CWD /public_html
Response: 250 Directory successfully changed.
Status: Retrieving directory listing...
Command: TYPE I
Response: 200 Switching to Binary mode.
Command: PASV
Response: 227 Entering Passive Mode (88,150,168,207,73,43).
Command: LIST
Response: 150 Here comes the directory listing.
Response: 226 Directory send OK.
Command: TYPE A
Response: 200 Switching to ASCII mode.
Command: PASV
Response: 227 Entering Passive Mode (88,150,168,207,222,74).
Command: STOR .htacess
Error: Connection timed out
Error: File transfer failed
Status: Connecting to 88.150.168.207:21...
Status: Connection established, waiting for welcome message...
Response: 220 Welcome to CodeBuster FTP service.
Command: USER codebuster
Response: 331 Please specify the password.
Command: PASS ********
Response: 230 Login successful.
Command: OPTS UTF8 ON
Response: 200 Always in UTF8 mode.
Status: Connected
Status: Starting upload of D:\Projects\codebuster\.htacess
Command: CWD /public_html
Response: 250 Directory successfully changed.
Status: Retrieving directory listing...
Command: TYPE I
Response: 200 Switching to Binary mode.
Command: PASV
Response: 227 Entering Passive Mode (88,150,168,207,35,185).
Command: LIST
Response: 150 Here comes the directory listing.
Response: 226 Directory send OK.
Command: TYPE A
Response: 200 Switching to ASCII mode.
Command: PASV
Response: 227 Entering Passive Mode (88,150,168,207,109,53).
Command: STOR .htacess
Error: Connection timed out
Error: File transfer failed
This is with iptbles off, so it's not a firewall issue. Size of the file is surely not an issue, as it's just one line with directory index setting.
As an additional note, this is a chrot directory, owned by codebuster:codebuster and permissions are drwxrw-rw-
.
Here are some additional notes:
a line from vsftpd log shows:
Sat Jan 10 14:46:23 2015 240 ::ffff:89.72.176.192 35 /public_html/.htacess a _ i r codebuster ftp 0 * c
, so it claims that the transfer was complete, but it was not.
Deleting files works correctly
Summary of tcpdump port ftp
shows:
100 packets captured
101 packets received by filter
0 packets dropped by kernel
Using active mode in ftp client does not change the situation.