ℕʘʘḆḽḘ
ℕʘʘḆḽḘ

Reputation: 19395

in linux, how to protect files from being erased/modified?

That might be a basic question, but I have a bunch of files that look like

top_secret_001
top_secret_002
etc

I would like to be sure that they are not erased nor modified by anyone. They should be readable though.

How can I do that in linux?

Thanks!

Upvotes: 0

Views: 135

Answers (2)

Lando
Lando

Reputation: 417

You could chown the file to be owned by root, and then chmod it to have 0644 permissions.

Anybody with sudo/root access can write to or delete the file, so beware!

Another thing to note, if a user has write permissions to the directory the file is in, they may delete the file. Even if the file is owned by root with read only permissions.

Upvotes: 1

DIEGO CARRASCAL
DIEGO CARRASCAL

Reputation: 2129

Changing the permissions and owner to root is as much as you can do... here is how File security

Upvotes: 1

Related Questions