LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   550 create directory operation failed in vsftpd (https://www.linuxquestions.org/questions/red-hat-31/550-create-directory-operation-failed-in-vsftpd-922686/)

coolpraz 01-08-2012 01:57 AM

550 create directory operation failed in vsftpd
 
Hi, all

I have established vsftpd in my rhel6 64 bit linux box and want to allow only anonymous login not local user. When i successfully login and try to make a directory (mkdir prabhat). it says "550 Create directory operation failed".

I have also change permission of /var/ftp
- chmod o+w /vat/ftp -

and also allow selinux
- setsebool -P ftp_home_dir=1

My vsftpd version is "vsftpd-2.2.2-6.el6.x86_64" and here is my vsftpd conf file: -
- anonymous_enable=YES
- local_enable=NO (I have disabled local enable)
- write_enable-YES
- #local umask=022 (I have commented local umask)
- anon_upload_enable=YES
- anon_mkdir_write_enable=YES
- dirmessage_enable=YES
- listen=YES
- pam_service_name=vsftpd
- userlist_enable=YES
- userlist_disable=YES
- tcp_warppers=YES

deep27ak 01-08-2012 03:39 AM

how are you trying to create the directory??

can you tell me the steps?

lithos 01-08-2012 06:35 AM

for anon user to have the rights to write/create subdirs you need to
chmod 777 /var/ftp

meaning that every file/dir below "/var/ftp" can be crated by any user.

coolpraz 01-08-2012 08:27 AM

Quote:

Originally Posted by deep27ak (Post 4569302)
how are you trying to create the directory??

can you tell me the steps?


ftp <ip addr>
ftp > mkdir prabhat
550 Creating directory operations failed

coolpraz 01-08-2012 08:59 AM

Quote:

Originally Posted by lithos (Post 4569372)
for anon user to have the rights to write/create subdirs you need to
chmod 777 /var/ftp

meaning that every file/dir below "/var/ftp" can be crated by any user.


still dosen't work same message appear again

bathory 01-08-2012 09:11 AM

Hi,

By default vsftpd does not allow writing into the anon_root directory.
If you want to be able to upload files and create directories as anonymous user, you should create a subdir, e.g. /var/ftp/pub and do what you want into that directory. Of course it must be owned by the ftp user

Regards

coolpraz 01-08-2012 12:13 PM

Quote:

Originally Posted by bathory (Post 4569449)
Hi,

By default vsftpd does not allow writing into the anon_root directory.
If you want to be able to upload files and create directories as anonymous user, you should create a subdir, e.g. /var/ftp/pub and do what you want into that directory. Of course it must be owned by the ftp user

Regards

I have change permission to all user (chmod 777 ftp, chmod 777 /ftp/pub) and also created a directory anonupload into pub then after change anonupload permission to all where i also change owner of dir to ftp (chown ftp:ftp anonupload/) then i loginto ftp try to create dir (mkdir) the message appear same.

bathory 01-08-2012 02:02 PM

Hi,

Quote:

I have change permission to all user (chmod 777 ftp, chmod 777 /ftp/pub)
By default in RHEL, the ftp user (it's the user used for anonymous logins) home directory is /var/ftp. So you have to create the pub under /var/ftp and make sure its owned by ftp:
Code:

mkdir /var/ftp/pub
chown ftp /var/ftp/pub

If you still cannot write into /var/ftp/pub, i.e. you cannot upload a file or create a directory, then check SELinux settings. I'm not familiar with it, but from the ftpd_selinux manpage, I guess you need to use:
Code:

chcon -t public_content_rw_t /var/ftp/pub
setsebool -P allow_ftpd_anon_write=1


deep27ak 01-09-2012 04:15 AM

If you are logging in default directory pub

then this is what you have to do
Code:

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

Code:

#ftp serverip
ftp>mkdir test
257 "/test/upload/test" created


coolpraz 01-09-2012 11:56 AM

Quote:

Originally Posted by bathory (Post 4569614)
Hi,


By default in RHEL, the ftp user (it's the user used for anonymous logins) home directory is /var/ftp. So you have to create the pub under /var/ftp and make sure its owned by ftp:
Code:

mkdir /var/ftp/pub
chown ftp /var/ftp/pub

If you still cannot write into /var/ftp/pub, i.e. you cannot upload a file or create a directory, then check SELinux settings. I'm not familiar with it, but from the ftpd_selinux manpage, I guess you need to use:
Code:

chcon -t public_content_rw_t /var/ftp/pub
setsebool -P allow_ftpd_anon_write=1


Thank you bathory, thanks a lot

It works now i can create directory into /var/ftp/pub by anonymous user, but i can't remove the directory that i created it's says "550 Permission Denied"

bathory 01-09-2012 12:32 PM

Hi,

Quote:

It works now i can create directory into /var/ftp/pub by anonymous user, but i can't remove the directory that i created it's says "550 Permission Denied"
By default vsftpd does not allow anonymous users to delete files/directories, because this way an anonymous user could delete something uploaded by another anonymous user. From the vsftpd.conf manpage:
Quote:

anon_other_write_enable
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
If you are absolutely sure you want this, then set the "anon_other_write_enable" to YES.

Regards

coolpraz 01-09-2012 01:39 PM

Quote:

Originally Posted by bathory (Post 4570352)
Hi,


By default vsftpd does not allow anonymous users to delete files/directories, because this way an anonymous user could delete something uploaded by another anonymous user. From the vsftpd.conf manpage:

If you are absolutely sure you want this, then set the "anon_other_write_enable" to YES.

Regards

thanks bathory now i can remove, rename file and directory by anonymous user in ftp. Thanks a lot ur help appreciated me

chaman k lalwani 10-15-2012 01:07 AM

Thanks bathory , this worked for me too.


All times are GMT -5. The time now is 12:44 PM.