V
V
vampire3332020-01-14 18:18:05
linux
vampire333, 2020-01-14 18:18:05

How to enable write in ubuntu and prevent further change?

There is a directory for saving text files in Ubuntu OS with many subdirectories by dates. The folder is accessible via ssh, ftp, smb, etc.
How to allow writing to a directory and subdirectories, at the same time forbid changing files (leave only for root?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Adamos, 2020-01-14
@Adamos

You can make two resources. One is for writing, the other is for reading only.
And move the files that appeared on the first one to the second one (inotifywait, for example), if they are not there yet.
From cryptographers, for example, it will help;)

U
uvelichitel, 2020-01-14
@uvelichitel

You can recursively set the append-only attribute. Not 100%, but still protection.
sudo chattr -R +a /path/to

K
Karpion, 2020-01-15
@Karpion

It seems normal to me to allow uploaded files to be changed for a while, especially if users are divided by access rights and cannot change other people's files, but only their own. And at midnight (or at three in the morning) change the file owner and access rights with a script.
In general, it seems to me that your requirements have gone beyond the capabilities of the file system. It is better to do this through Web access, where you can do anything with scripts.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question