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

1 Answers1

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.

ezra-s
  • 2,215
  • 1
  • 7
  • 13
  • 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 – ezra-s Sep 27 '17 at 11:40