1

The network configuration doesn't allow access to FTP from outside the building. There's one user that need to upload and change files from a specific folder so I've installed TinyFileManager

https://tinyfilemanager.github.io/

  1. Created the folder
  2. Configured tfm.php script with user/pass/etc.
  3. Set folder to 755
  4. Added linux user to www-data
  5. Chown folder -R to user:www-data (including tfm.php)

User still cannot create a sub-folder or new file. Cannot upload and overwrite any file. I've set all files to 644 and sub-folders to 755

Which would be the correct permissions and ownerships so the user can change everything in that folder ? without compromising sec.

Thanks

Enrique Becerra
  • 145
  • 3
  • 8

1 Answers1

0

Your files and folders need write permissions for the group.

That means 775 for folders and 664 for files.

If the server has selinux enabled (most probably not the case on debian, but for completeness) you need to set the correct security context for the files and folders as well.

Gerald Schneider
  • 23,274
  • 8
  • 57
  • 89
  • Set the files to 664 and folders to 775 but the newly created folders are set to 755 with www-data:www-data as owner and files are created/uploaded to 644... check: https://imgur.com/U2GT1n1 I think I'll have to modify the script so it can set folders to 775 and files to 664 when uploading/creating ? – Enrique Becerra Apr 12 '19 at 12:40
  • `755` for newly created folders is okay as long as the owner matches. Which it does in the screenshot. – Gerald Schneider Apr 12 '19 at 12:42
  • Yea, but the problem is that I create a new subfolder, create a file, edit the file and save. Then I upload a file with same name, and does not overwrite. It renames it :/ – Enrique Becerra Apr 12 '19 at 12:52
  • Sounds like a "feature" of your file manager. Linux does not rename files when you try to save an existing file. – Gerald Schneider Apr 12 '19 at 12:55
  • That's correct. The filemanager renames the file when cannot overwrite it, and that's due these permissions problems – Enrique Becerra Apr 12 '19 at 15:59