Вы задаете трудный вопрос. Вот настройки в MySQL:
И от ОС/файловой системы/и т.д.:
You can try to use 'chattr'
Example:
urug@nada.cclan:~$ sudo chattr +i plik.txt
urug@nada.cclan:~$ rm plik.txt
rm: remove write-protected regular empty file `plik.txt'? y
rm: cannot remove `plik.txt': Operation not permitted
urug@nada.cclan:~$ chattr -i plik.txt
chattr: Operation not permitted while setting flags on plik.txt
Use attributes
sudo chattr +i /path/to/file
Remove "immutable" flag with
sudo chattr -i /path/to/file
That'll prevent you from changing permission on the file, though. So you'll need some way to (as root) add execute permission or whatever upon user request. Also, attributes are not added by default; you have to put in somethin that will do that to.
I'll leave that bit as an exercise to the reader.
SELinux может быть одним из способов решения этой проблемы - связать уникальный тип со всеми пользователями, у которых будет эта «ограниченная способность». Установите политику SELinux, чтобы разрешить создание файлов в этом каталоге для этих типов пользователей, но не изменять и т. Д. Теоретически - должно работать. См. Учебное пособие по Gentoo SELinux , в частности, о:
allow auditd_t <type>:file { <permission> };
Используйте inotify или другой механизм наблюдения вашего выбор, чтобы найти новые файлы в каталоге загрузки и переместить их в новый каталог, для которого у исходного пользователя нет разрешений.