0

I have create a small LAMP server with Apache 2.4 and PureFTP but i have configured the folder of user /home/user1/ with chmod permission username:username for pureftp in this case via filezille i can edit and upload file but apache can't read or write file, if config apache:apache or root:root all work but via fizilla i can't upload or edit file.

I'm not that good with permission and this is my first LAMP installation =)

File permission for folder 755 and 644 for files, user and group for /home is root for /home/username is the respective user.

Run apache with nobody user and nobody group

etc/passwd for nobody: nobody:x:99:99:Nobody:/:/sbin/nologin etc/group for nobody: nobody:x:99:

Please can you help me?

I use Centos 7 x64.

Thanks.

  • 1
    Why don't you make a default folder like /var/www/html as document root of your apache server and make the same folder as home folder for your ftp user. That would solve your problem. Don't change permissions or ownership of users home folder. You'd end up loosing ssh acces of your server. – Shailesh Sutar Sep 22 '17 at 10:36
  • Because i have configured the /home with 100GB of space for multiple users – user3477026 Sep 22 '17 at 10:38
0

In unix not only "destination permissions" matter, also the permissons along the whole path to reach the destination.

So make sure directories have at least "search" permissions "x" An make sure files have at least read "r", so user nobody can read them.

"namei" is a good tool to check those:

Try:

namei -mol /path/to/directory/file 

if your system version does not recognize -mol, you may use "-mx" as alternative which seems compatible with older versions of namei.

  • dr-xr-xr-x root root / drwxr-xr-x root root home drwxr-xr-x username username username – user3477026 Sep 26 '17 at 22:10
  • @user3477026 what about the upload directory, I see access but I don't see write for the upload directory. In apache check the appropiate <Directory entry specifies the filesystem path giving permissions too. For further detail, show what you request and the answer you get as well as the server error log. – ezra-s Sep 27 '17 at 11:40

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.