Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a problem with vsftpd not allowing anonymous users to append to files that they have uploaded. Uploading files initially works perfectly file. Changing the permissions on the uploaded files does not help. Is there a setting that I have not been able to find that allows appending to existing files?

For some background, the problem I am trying to solve is allowing uploads to continue if the upload is broken.

An example is found in the following log:

Tue Jan  3 14:06:38 2012 [pid 28433] CONNECT: Client "xxx.xxx.xxx.xxx"
Tue Jan  3 14:06:38 2012 [pid 28433] FTP response: Client "xxx.xxx.xxx.xxx", "220 (vsFTPd 2.2.2)"
Tue Jan  3 14:06:40 2012 [pid 28433] FTP command: Client "xxx.xxx.xxx.xxx", "USER anonymous"
Tue Jan  3 14:06:40 2012 [pid 28433] [anonymous] FTP response: Client "xxx.xxx.xxx.xxx", "331 Please specify the password."
Tue Jan  3 14:06:41 2012 [pid 28433] [anonymous] FTP command: Client "xxx.xxx.xxx.xxx", "PASS <password>"
Tue Jan  3 14:06:41 2012 [pid 28432] [ftp] OK LOGIN: Client "xxx.xxx.xxx.xxx", anon password "?"
Tue Jan  3 14:06:41 2012 [pid 28434] [ftp] FTP response: Client "xxx.xxx.xxx.xxx", "230 Login successful."
Tue Jan  3 14:06:41 2012 [pid 28434] [ftp] FTP command: Client "xxx.xxx.xxx.xxx", "SYST"
Tue Jan  3 14:06:41 2012 [pid 28434] [ftp] FTP response: Client "xxx.xxx.xxx.xxx", "215 UNIX Type: L8"
Tue Jan  3 14:06:56 2012 [pid 28434] [ftp] FTP command: Client "xxx.xxx.xxx.xxx", "CWD uploads"
Tue Jan  3 14:06:56 2012 [pid 28434] [ftp] FTP response: Client "xxx.xxx.xxx.xxx", "250 Directory successfully changed."
Tue Jan  3 14:06:59 2012 [pid 28434] [ftp] FTP command: Client "xxx.xxx.xxx.xxx", "TYPE I"
Tue Jan  3 14:06:59 2012 [pid 28434] [ftp] FTP response: Client "xxx.xxx.xxx.xxx", "200 Switching to Binary mode."
Tue Jan  3 14:06:59 2012 [pid 28434] [ftp] FTP command: Client "xxx.xxx.xxx.xxx", "PORT xxx.xxx.xxx.xxx,229,167"
Tue Jan  3 14:06:59 2012 [pid 28434] [ftp] FTP response: Client "xxx.xxx.xxx.xxx", "200 PORT command successful. Consider using PASV."
Tue Jan  3 14:06:59 2012 [pid 28434] [ftp] FTP command: Client "xxx.xxx.xxx.xxx", "STOR test"
Tue Jan  3 14:06:59 2012 [pid 28434] [ftp] FTP response: Client "xxx.xxx.xxx.xxx", "150 Ok to send data."
Tue Jan  3 14:06:59 2012 [pid 28434] [ftp] OK UPLOAD: Client "xxx.xxx.xxx.xxx", "/uploads/test", 12 bytes, 0.15Kbyte/sec
Tue Jan  3 14:06:59 2012 [pid 28434] [ftp] FTP response: Client "xxx.xxx.xxx.xxx", "226 Transfer complete."
Tue Jan  3 14:07:11 2012 [pid 28434] [ftp] FTP command: Client "xxx.xxx.xxx.xxx", "PORT xxx.xxx.xxx.xxx,222,100"
Tue Jan  3 14:07:11 2012 [pid 28434] [ftp] FTP response: Client "xxx.xxx.xxx.xxx", "200 PORT command successful. Consider using PASV."
Tue Jan  3 14:07:11 2012 [pid 28434] [ftp] FTP command: Client "xxx.xxx.xxx.xxx", "APPE test"
Tue Jan  3 14:07:11 2012 [pid 28434] [ftp] FTP response: Client "xxx.xxx.xxx.xxx", "550 Permission denied."
Tue Jan  3 14:07:13 2012 [pid 28434] [ftp] FTP command: Client "xxx.xxx.xxx.xxx", "QUIT"
Tue Jan  3 14:07:13 2012 [pid 28434] [ftp] FTP response: Client "xxx.xxx.xxx.xxx", "221 Goodbye."
share|improve this question

1 Answer 1

up vote 2 down vote accepted

I'd suggest you want to set anon_other_write_enable to YES.

As per the vsftpd documentation:

If set to YES, anonymous users will be permitted to perform write operations other than upload and create directory, such as deletion and renaming. This is generally not recommended but included for completeness. Default: NO

The problem though, is that with this, any anonymous user could modify/overwrite any other anonymously uploaded file.

(As a point of mention, vsftpd defines 'write operations' as: STOR, DELE, RNFR, RNTO, MKD, RMD, APPE and SITE.)

share|improve this answer
    
Thanks for that answer. Do you know whether it is possible to restrict writing to a finer granularity? E.g. only APPE? –  Shane Jan 4 '12 at 9:35
    
It's been a while since I used vsFTPd - I mostly use SFTP these days - and have never used anonymous FTP. However, you should probably disable anon_mkdir_write_enable and look into cmds_allowed and cmds_denied. You may be able to combine the latter two with user_config_dir (although I have no idea if it would work with anonymous FTP). I am sure you have your reasons for using it, but anonymous FTP isn't exactly known for its security. –  cyberx86 Jan 4 '12 at 10:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.