LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   vsftpd & "553 could not create file" (http://www.linuxquestions.org/questions/linux-server-73/vsftpd-and-553-could-not-create-file-376022/)

steffentchr 10-23-2005 09:38 AM

vsftpd & "553 could not create file"
 
I'm setting up vsftpd (2.0.3, FC4) with virtual users. When a user logs in, he should be able to upload files to /ftp, but when I try I'm not able to create/upload files, and I get an "553 Could not create file" error message. I can browse directories and delete files without any problems.

I've printed some info about my basic config, and I hope that you guys will be able to help me...

/Stc



vsftpd.conf:
anonymous_enable=YES
local_enable=YES
write_enable=YES
local_umask=022
anon_umask=077
anon_upload_enable=YES
anon_mkdir_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
chown_uploads=YES
chown_username=ftp
xferlog_std_format=YES
pam_service_name=ftp
listen=YES
tcp_wrappers=YES
guest_enable=YES
guest_username=ftp
local_root=/ftp
anon_other_write_enable=YES
chroot_local_user=YES
virtual_use_local_privs=YES



[root@nordsign /]# ls -al
total 242
drwxr-xr-x 30 root root 4096 Oct 19 16:23 .
drwxr-xr-x 30 root root 4096 Oct 19 16:23 ..
(...)
drwxrwxrwx 3 ftp web 4096 Oct 20 10:40 ftp
(...)




Macintosh:~ steffentchr$ ftp ftp.dummy.com
Connected to ftp.dummy.com.
220 (vsFTPd 2.0.3)
Name (ftp.dummy.com):steffentchr): steffen
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
226 Directory send OK.
ftp> put Desktop/stc1
local: Desktop/stc1 remote: Desktop/stc1
229 Entering Extended Passive Mode (|||64727|)
553 Could not create file.

GaMeS 10-24-2005 11:17 PM

hi,

your users "steffen" ..what's her primary and secondary group ?

if you create a file on '/ftp' , users "steffen" can retrieve ? and read it ? or not ?

steffentchr 10-25-2005 12:43 AM

There's no "steffen" user; along with loads of others it a virtual user mapping against a pam db. As I understand permissions should be based on the ftp-user (guest_username)?

Thanks,
/Stc

feathers 11-01-2005 05:06 PM

I was experiencing the same error. It turned out that a file of the same name already existed in the upload directory.

After deleting the same named file from the upload directory, I got "226 File receive OK."

mmiric 11-16-2008 04:49 AM

I solve problem with granting ownership to directory. Command was chown -R webadmin2 /var/www/html.

Nuthan Santharam 01-23-2012 01:54 AM

chown -R webadmin2 /var/www/html
 
chown -R webadmin2 /var/www/html works beautifully....
Response: 226 Directory send OK.

deep27ak 01-23-2012 08:34 AM

Quote:

anonymous_enable=YES
local_enable=YES
write_enable=YES
local_umask=022
anon_umask=077
anon_upload_enable=YES
anon_mkdir_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
chown_uploads=YES
chown_username=ftp
xferlog_std_format=YES
pam_service_name=ftp
listen=YES
tcp_wrappers=YES
guest_enable=YES
guest_username=ftp
local_root=/ftp
anon_other_write_enable=YES
chroot_local_user=YES
virtual_use_local_privs=YES
with this setting you are trying to log in using anonymous user

so you should know that by default anonymous user is not allowed to login on any directory having write permission
so you default login directory inside

Code:

/var/ftp/pub
should not have write access

once our anonymous user logs in then he will not be able to create any file or directory
so for this reason create a directory inside pub with full permission

Code:

#mkdir /var/ftp/pub/upload
#chmod 777 /var/ftp/pub/upload

or make sure to give relevant permission as per your use with write permission enabled

so once the anonymous user logs in
Code:

ftp ftp.dummy.com
Connected to ftp.dummy.com.
220 (vsFTPd 2.0.3)
Name (ftp.dummy.com):steffentchr): anonymous
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
226 Directory send OK.
ftp>pwd
ftp>/var/ftp
ftp>dir
pub
upload
ftp>cd upload
ftp>mkdir test
ftp>dir
test


AKStorch 04-03-2012 04:43 PM

chown -R webadmin2 /var/www/html works beautifully here also
Response: 226 Directory send OK.

digital_misfit 06-28-2012 01:52 PM

Works
 
Quote:

Originally Posted by Nuthan Santharam (Post 4581843)
chown -R webadmin2 /var/www/html works beautifully....
Response: 226 Directory send OK.

Second that, works perfectly.


All times are GMT -5. The time now is 10:48 PM.