Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Example directory structure:


I want to give full write and create permissions inside the protected dir to some specific userA, but without letting userA rename or move that container dir. No touching the dirs name or location, but full freedom inside. And userA owns the parent directory as well.

What would be the best way to achieve this?

The current level of solution I could reach is this (with the help of @nobar):

How can I forbid a directories rename while allowing file creation operations inside and outside same directory?

share|improve this question
Your example is more complex than your description. What access do you want to provide for various-userA-files-and-directories? – nobar Jun 23 '13 at 16:40
Since I don't understand the question well enough to write an answer, I'll just give a hint: use the "GROUP" feature of Linux filesystems (see chown and chmod for starters). – nobar Jun 23 '13 at 16:42
Sorry for the complex example, I will simplify. – Johan Jun 23 '13 at 18:09
I don't see a way to do that directly. You might be able to solve your problem by using a symbolic link to a directory at another location. – nobar Jun 23 '13 at 20:56

What you are trying to do, if I understand it, is quite common -- this is just creating a shared folder.

Maybe what you are missing is the fact that renaming a directory is not controlled by the same permission as modifying the contents of that directory -- the name of the shared directory is protected at the level of its parent directory.

In the simplest case, all you need to do is:

chmod o-w parent ## prevent others from modifying the parent directory
chmod o+rwx parent/THE-UNMOVABLE-UNRENAMABLE-PROTECTED-DIR ## others can write

But the preceding will allow any user to modify the shared directory. For a more sophisticated setup you might manipulate the OWNER and/or GROUP of the target directory:

/parent -- OWNER:you, GROUP:you
      /userA-files-and-directories/ -- OWNER:userA, GROUP:userA

Use chown and/or chmod to manipulate the properties of THE-UNMOVABLE-UNRENAMABLE-PROTECTED-DIR. You can see the properties using ls -l.

You might choose to set the OWNER and GROUP to separate values, but this is probably only necessary if you want to allow multiple users while also controlling who has access.

share|improve this answer
Thank you for the answer, but it is not exactly what I needed. The parent directory is userA space. I will clarify the question a bit more. – Johan Jun 23 '13 at 19:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .