The best way to make something read only (even by root) is using the chattr
immutable (i) flag, i.e.
sudo chattr +i file
This will prevent casual changes by every user including root.  Change it
back with the -i flag.
Any attempt to change the file or directory will get an operation not
permitted error.
Use lsattr to find the extended attributes of a file or directory.  See the
man page for all the other attributes.

On Fri, Oct 27, 2023 at 6:12 AM Rich Shepard <[email protected]>
wrote:

> On Thu, 26 Oct 2023, Bill Barry wrote:
>
> > You want them read only, 600 is read/write.  Read by world would be good
> > might work better
>
> Bill,
>
> I considered that but limiting both reading and writing to 'user' doesn't
> hurt.
>
> > chmod -R 004   *
>
> Shouldn't that be 400 (user, group, other)?
>
> Rich
>

Reply via email to