Folder permissions

Discussion in 'Linux' started by dragonbite, Nov 30, 2010.

  1. dragonbite

    dragonbite Well-Known Member

    Aug 30, 2008
    Likes Received:
    At the last Linux SIG meeting I brought up the question regarding making a shared folder (/home/SHARE) which has read & write access to the parents, and read-only access by the kids. I wanted to follow up with that in that I managed at least part of the solution. :help

    I was pointed to the solution after posting this question the Ubuntu Forums (here) which lead me to a Linux Forum article on File Permissions.

    The solution, so far, is thus:

    • I create a group, which I call "parents", and make sure my wife and I are in this group.
    • I change the group to all of the content of the shared directory (files and folders) to belong to this "parents" group
      sudo chgrp  parents -R /home/SHARE
    • Then I make it so all files saved under this directory automatically get the group of the parent folder, in this case "parents"
      sudo chmod g+s -R /home/SHARE
      if I want to later remove this feature, I can use
      sudo chmod g-s -R /home/SHARE
      [/list:u] This works. :yippee When I save a file in the sub-directories it saves it automatically with the group Id of "parents".

      Now my current issue is that when a file is created it automatically is saved with read & write for the owner only, and read-only for group and other users. This I am looking at how to change it anything saved in this directory is given read & write to owner and group, and read-only to all other users. I believe the solution may be in "umask", I just need more documentation on it before I give it a try.

      I can manually change it using
      sudo chmod 775 -R /home/SHARE
      but that is not an ideal solution.

Share This Page