Which would be the right chmod
value for a directory where everyone can write on it, but only the owner of the content can delete it?
I thought chmod 1755 path_to_directory
would be the right one, but it isn't.
I am beginner on linux, i tried finding this on google, but i wasn't successful.
You want to allow everyone to write to the directory, but restrict deletions to only the owner of the content. So, the right command would be:
The "others" must have write permission to create things (and the "sticky bit" restricts deletions). Read the man page of
chmod
to understand it better (man chmod
).An equivalent (and probably easier to understand) command is:
a+rwx
adds read (r), write (w) and execute (x) permission to all (a)+t
adds the "sticky bit" to the directory (which restricts deletion of files/folders inside to just their owner)