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

2
  • What distribution is running on the server? Apr 12, 2019 at 12:24
  • @GeraldSchneider Debian 8.6 (jessie) Apr 12, 2019 at 12:26

1 Answer 1

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.

5
  • 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: 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 ? Apr 12, 2019 at 12:40
  • 755 for newly created folders is okay as long as the owner matches. Which it does in the screenshot. Apr 12, 2019 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 :/ Apr 12, 2019 at 12:52
  • Sounds like a "feature" of your file manager. Linux does not rename files when you try to save an existing file. Apr 12, 2019 at 12:55
  • That's correct. The filemanager renames the file when cannot overwrite it, and that's due these permissions problems Apr 12, 2019 at 15:59

You must log in to answer this question.

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