VSFTPD Fedora 12 Default Directory Change

We have a Fedora 12 server for FTP.  After configuring VSFTPD, we can login and find files in /var/ftp fine.  We want to change the default /var/ftp directory to our own /ftp partition we have setup.  Changing "anon_root" to "/ftp" simply disables us from logging into the FTP server, from our web browser and FileZilla.

How can we change the /var/ftp directory to /ftp in VSFTPD?

Thanks in advance.
getekeAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

woolmilkporcCommented:
Hi,
that's the parameter anon_root in /etc/vsftpd.conf (or /etc/vsftpd/vsftpd.conf).
You most probably ru the vsftpd daemon via inetd or xinetd, in this case you don't need to restart anything.
wmp
woolmilkporcCommented:
...sorry, pressed submit too early ...
What are the permissions of /ftp? It must be accessible ("r", "w" if desired and "x") by ftp_username as configured in vsftpd.conf, (or ftp by default).
getekeAuthor Commented:
The ftp user has full read permissions.  Where in vsftpd.conf would this be configured?
Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

woolmilkporcCommented:
Permissions are configured for the filesystem, not in vsftpd.conf.
e.g.
chown -R ftp /ftp
chmod -R u+rwx /ftp
In vsftpd.conf you configure the id to be used for anonymous transfers, the root of the directory tree to use.,
and some ftp actions to be allowed in an "anonymous" session, e.g. anon_upload_enable or anon_mkdir_write_enable.
ftp write are allowed or forbidden globally (not for "anonymous" alone) with write_enable
getekeAuthor Commented:
When "anon_root" is commented out(disabled),  I am able to login to /var/ftp fine in both FileZilla and IE.  When "anon_root" is active(enabled), it gives me error "500 OOPS: cannot change directory:".

Why is this happening?

Thanks for all your help.
woolmilkporcCommented:
Issue ls -ld /ftp
It must look similar to this
drwxr-xr-x 1 ftp ftp 9999 Apr 29 00:00 /ftp
(Important values in bold)
 
getekeAuthor Commented:
The only difference between our folder and the one you list is the "9999", which ours is "4096". No effect.  Does the 4096 need to be changed?
woolmilkporcCommented:
No, don't worry. That's the size of the directory. I used 9999 since I don't know your value, obviously.
Do you actually log in with "ftp" or "anonymous"? Without having to enter a password? Or do you use a locally configured userid (not "ftp")?
In this case you're not "anonymous", and other rules apply.
I'd suggest trying "anonymous" to log in to vsftpd and see what happens.
Note - the name "ftp" you use to login has nothing to do with the user whose account will be actually used! This account is configured with "ftp_user".
Seems that in your case this user is also called "ftp" which is not mandatory at all. You could as well enter "anonymous"
 
getekeAuthor Commented:
Even as "anonymous" or "ftp" with "anon_root" and "local_root" set, the error still appears.
Under the same users but with "anon_root" and "local_root" disabled, the users log in fine (even though they go to the incorrect directory i would like)

Is there a better FTP software to use in Fedora other than VSFTPD?
woolmilkporcCommented:
vsftpd is really not bad. It must work!
How does the "anon_root" entry look like in your config? Remember there may not be spaces around the equal sign!
anon_root=/ftp
getekeAuthor Commented:
It looks just like you have it.

I have been reading that you should change the home directory of the anonymous ftp user that logs in.  Would that have anything to do with it?
woolmilkporcCommented:
The home directory is certainly not related to the "OOOPS" thing you have.
What was the reason given to change that directory?
And I think I made a mistake when suggesting to give /ftp to the user "ftp" (chown)! What I wanted to say is give all subdirectories of /ftp to that user, but not /ftp itself! This directory should belong to root!
getekeAuthor Commented:
We have created a separate partition called "/ftp" for the ftp users to log in and access the files.  From within vsftpd.conf, we are trying to change it from "/var/ftp" to "/ftp" but are unable to do so.  "root" is the owner of /ftp.
getekeAuthor Commented:
I have discovered the answer.

The solution is to use fstab to point the /var/ftp directory to /ftp.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.