Results 1 to 5 of 5

Thread: Path permissions not being inherited

  1. #1
    Join Date
    Dec 2005
    Beans
    Hidden!
    Distro
    Kubuntu

    Path permissions not being inherited

    Have noticed a lot of paths with permissions of 775.

    So, I went to a path that was 755, added a new sub path, and it was made permissions of 775.

    There does not seem to be a permissions inheritance in place ??

  2. #2
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: Path permissions not being inherited

    The permissions normally don't get inherited from the parent (set-group-ID and set-user-ID being exceptions on directories). Look what the output of 'umask' is. That would define the default permissions for newly created files and directories.

  3. #3
    Join Date
    Dec 2005
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Path permissions not being inherited

    Okay thanks, here is the output of umask ..

    Code:
    $ umask
    0002
    Does that look right ?

    EDIT: It seems that the default permissions changed in 12.04, see this post

    How do I change the default permissions ?
    Last edited by oygle; February 9th, 2013 at 05:24 AM.

  4. #4
    Join Date
    Dec 2005
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Path permissions not being inherited

    Considering the informative post by "Morbius1" here, a snippet ..

    On Linux Filesystems

    At the moment of birth every file has permissions of 666 and every directory has permissions of 777. A system wide umask is created to modify these permissions immediately after birth and it's currently set at 002. So when you create a new file it's permissions are:

    666
    002 <-- minus the umask
    ==
    664

    And every new directory has permissions of:

    777
    002 <-- minus the umask
    ==
    775
    and the "umask" value I have is 0002.

    Now it all makes sense, because my files are defaulting to 664, and paths are defaulting to 775

    This change was made in *Ubuntu some time ago.

    How do I change the umask to a value of 0022 , so that I get ..

    Files 644
    Folders 755

    Oygle

  5. #5
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: Path permissions not being inherited

    Well, if you want to change the default only for one user then put umask 022 into ~/.bash_profile, ~/.bashrc or some other shell start-up file for that user.

    For changing the system-wide default, put a short script that contains
    Code:
    umask 022
    into the directory /etc/profile.d. Name it, say umask.sh. This way, it'll override the umask set either in /etc/profile or in /etc/login.defs, but won't interfere with other things in those files.

    Sure, you're free to directly change the default setting in /etc/login.defs instead, but I guess then this file won't get updated automatically with the rest of the system.

Bookmarks

Posting Permissions

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