-1

There is a general report template that someone has reserved only for the CEO. Since the file has to be editable, viewable, and deletable by everyone, what permission value should he set?

My first assumption is that the read permission will make it viewable and the write permission will make it editable and deletable by anyone. I would like some guidance to make sure that I am on the right track.

My options to choose for are:

chmod 777
chmod 755
chmod 700
chmod 600
1

2 Answers 2

1

You're right about read and write, with a caveat (see below). For deletability, though, this depends on write access to the enclosing directory, not any property of the file itself. (It's more complicated if the directory has the "sticky bit" set, but that's probably not relevant here.)

A mode of 777 doesn't make much sense because there is no point in executing the file. The mode you want for world- writability and readability is 666.

(Caveat about the first sentence: To be able to do anything to the file, you also have to be able to get to it, which requires 'x' access on all directories along the path.)

1
  • That makes sense. Thank you for your concise explanation.
    – Elias
    Mar 15 at 20:20
0

If the file has to be viewable, editable, and deletable by anyone, a 666 mode is what you need (chmod 666). Note that, as hinted by @cind, the directory containing the file should be mode 777; read permission (r) to list files in the directory, write permission (w) to delete a file in it, and execute permission (x) to enter the directory. Parent directories through the full path only need execute permission.

However, note that this will give full access to anyone having an account on the system. You might want to use ACLs to fine-tune the access to the file.

Also, you won't know who made which modification, or who deletes the file -- unless you set up auditd to do so, but this seems overkill, and for this purpose a versioning system such as git would work much better.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.