Find the answer to your Linux question:
Results 1 to 2 of 2
Is their a way to set specific permissions on a parent folder, but allow read/write to the child folders? For instance, my company uses Debian for medical charting on our ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2013
    Posts
    1

    Lock the parent folder only


    Is their a way to set specific permissions on a parent folder, but allow read/write to the child folders? For instance, my company uses Debian for medical charting on our clients. I want our employees to login and see the clients folders, but not actually add or remove clients. However, they need to add files to the subfolders under each client. Does this make sense?

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,539
    Absolutely that make sense. First create a group that users who have permissions to access these folders (the root ones), and write permissions to the child folders, then set group ownership to all the folders to the group (the owner should still be root, or some admin account). Then, set the directory permissions to the root ones to read-only for group and others. For the client folders, set group permissions to read-write-execute, and others to no-access. The results are this:

    • The write bit allows the affected user to create, rename, or delete files within the directory, and modify the directory's attributes
    • The read bit allows the affected user to list the files within the directory
    • The execute bit allows the affected user to enter the directory, and access files and directories inside



    To do this:
    Code:
    chmod o-wx rootdirs clientdirs
    chmod o+r rootdirs clientdirs
    chmod g+rx rootdirs
    chmod g+rwx clientdirs
    You may also need to protect some files from access inside these directories as needed. I'm not 100% sure this will do what you need, so experiment a bit until you are sure you have access locked down adequately, but open enough for your user needs.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •