configuring vsftpd anonymous upload. Creates files but freezes at 0 bytes
- by Wayne
vsftpd on ubuntu after sudo apt-get install vsftpd
Then did configuration as in the attached /etc/vsftpd.conf file.
Anonymous ftp allows cd to the upload directly and allows
put myfile.txt which gets created on the server but then
the client hangs and never proceeds. The file on the server
remains at 0 bytes.
Here's the folders and permissions:
root@support:/home/ftp# ls -ld .
drwxr-xr-x 3 root root 4096 Jun 22 00:00 .
root@support:/home/ftp# ls -ld pub
drwxr-xr-x 3 root root 4096 Jun 21 23:59 pub
root@support:/home/ftp# ls -ld pub/upload
drwxr-xr-x 2 ftp ftp 4096 Jun 22 00:06 pub/upload
root@support:/home/ftp#
Here's the vsftpd.conf file:
root@support:/home/ftp# grep -v '#' /etc/vsftpd.conf
listen=YES
anonymous_enable=YES
write_enable=YES
anon_upload_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
anon_root=/home/ftp/pub/
connect_from_port_20=YES
chown_uploads=YES
chown_username=ftp
nopriv_user=ftp
secure_chroot_dir=/var/run/vsftpd
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
Here's a file example that attempted to upload:
root@support:/home/ftp/pub/upload# ls -l
total 0
-rw------- 1 ftp nogroup 0 Jun 22 00:06 build.out
This is the client attempting to upload...it is frozen at this point:
$ ftp 173.203.89.78
Connected to 173.203.89.78.
220 (vsFTPd 2.0.6)
User (173.203.89.78:(none)): ftp
331 Please specify the password.
Password:
230 Login successful.
ftp> put build.out
200 PORT command successful. Consider using PASV.
553 Could not create file.
ftp> cd upload
250 Directory successfully changed.
ftp> put build.out
200 PORT command successful. Consider using PASV.
150 Ok to send data.