1

I have a CentOS server machine and i installed vsftpd server following this article : http://www.cyberciti.biz/tips/centos-redhat-vsftpd-ftp-with-virtual-users.html

I have created a virtual user but in vsftpd.conf i did the following:

local_root=/var/www/html

And after chowning the web root chown -R ftp:ftp /var/www/html the permissions are like this:

drwxrwsr-x  4 ftp  ftp  4096 Feb 22 17:28 .
drwxr-xr-x 10 root root 4096 Oct 21 00:05 ..
drwxr-sr-x  2 root ftp  4096 Feb 22 17:28 fromconsole
-rwxrwsr-x  1 ftp  ftp    30 Feb 19 20:02 index.html
drwxrwsr-x  3 ftp  ftp  4096 Feb 22 17:19 fromftpclient

As you can see, fromconsole is folder created with mkdir, fromftpclient is folder created by FileZilla

And when i upload from a FTP Client (FileZilla), the folders are with ftp ownership, but if i create folder/files from the console, i cannot access them via the FTP client.

My question is - What is the best practice to do the thing with the FTP account and the apache web root ?

1 Answer 1

1

All that matters to apache is that it can read the files.
As long as the "other" group has read permissions on files and read+execute permissions on directories, apache will be able to serve the content.

As for the difference between FTP-ing a file and creating it as root - yes, obviously there is a difference, since you created it as root.

Don't do that, then.

2
  • So, if i want to deploy something, i should go with ftp user/group and not root ? :) Commented Feb 23, 2012 at 11:29
  • Certainly. since root-owned content can't be edited by non-root users later, this is not very efficient for uploadable web content.
    – adaptr
    Commented Feb 23, 2012 at 11:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .