LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 01-08-2012, 01:57 AM   #1
coolpraz
Member
 
Registered: Feb 2010
Posts: 35

Rep: Reputation: 0
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
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 01-08-2012, 03:39 AM   #2
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
how are you trying to create the directory??

can you tell me the steps?
 
Old 01-08-2012, 06:35 AM   #3
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
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.
 
Old 01-08-2012, 08:27 AM   #4
coolpraz
Member
 
Registered: Feb 2010
Posts: 35

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by deep27ak View Post
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
 
Old 01-08-2012, 08:59 AM   #5
coolpraz
Member
 
Registered: Feb 2010
Posts: 35

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by lithos View Post
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
 
Old 01-08-2012, 09:11 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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
 
Old 01-08-2012, 12:13 PM   #7
coolpraz
Member
 
Registered: Feb 2010
Posts: 35

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
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.
 
Old 01-08-2012, 02:02 PM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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

Last edited by bathory; 01-08-2012 at 03:46 PM.
 
2 members found this post helpful.
Old 01-09-2012, 04:15 AM   #9
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
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
 
Old 01-09-2012, 11:56 AM   #10
coolpraz
Member
 
Registered: Feb 2010
Posts: 35

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
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"
 
Old 01-09-2012, 12:32 PM   #11
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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
 
2 members found this post helpful.
Old 01-09-2012, 01:39 PM   #12
coolpraz
Member
 
Registered: Feb 2010
Posts: 35

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
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
 
Old 10-15-2012, 01:07 AM   #13
chaman k lalwani
LQ Newbie
 
Registered: Oct 2012
Posts: 1

Rep: Reputation: Disabled
Thanks bathory , this worked for me too.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] 550:Failed to change directory divyashree Linux - Server 12 09-21-2020 07:26 AM
vsftp 550 failed to change directory? swatward Linux - Software 2 08-25-2010 07:10 PM
create directory failed in vsftpd djunaedi Linux - Newbie 6 10-20-2009 03:44 AM
vsftp - 550 Failed to change directory mayankh Linux - Server 3 06-24-2008 10:52 PM
FTP : failed to change directory 550 vijit Linux - Networking 2 04-08-2008 03:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 11:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration