-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
dr_
  • 29,602
Elias
  • 1

2 Answers2

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.)

cind
  • 41
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.

dr_
  • 29,602