Andreas Hartmann Asked: 2014-08-21 07:19:08 +0800 CST2014-08-21 07:19:08 +0800 CST 2014-08-21 07:19:08 +0800 CST How to prevent data from being written into a directory? 772 Or: How to make a directory write protected, for all users until unlocked again? filesystem 1 Answers Voted Best Answer Rmano 2014-08-21T07:26:01+08:002014-08-21T07:26:01+08:00 You can simply use (1) chmod a-w directory which will make the directory unwritable to everyone. To give write access to all users: chmod a+w directory For more fine access, there is a nice tutorial on Unix permissions here; if you need even more fine-grained control, you can use Access Control Lists (this last link is for Arch Linux, but works on Ubuntu too). Footnotes: (1) this is if you are the owner of the directory and you have write access on the parent directory. Otherwise, you have to do it with superuser privileges, like: sudo chmod a-w directory and sudo chmod a+w directory
You can simply use (1)
which will make the directory unwritable to everyone.
To give write access to all users:
For more fine access, there is a nice tutorial on Unix permissions here; if you need even more fine-grained control, you can use Access Control Lists (this last link is for Arch Linux, but works on Ubuntu too).
Footnotes:
(1) this is if you are the owner of the directory and you have write access on the parent directory. Otherwise, you have to do it with superuser privileges, like:
and