Folder permissions don't seem to apply to post added items

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
Benzius
Level 1
Level 1
Posts: 7
Joined: Mon Apr 20, 2020 4:45 am

Folder permissions don't seem to apply to post added items

Post by Benzius »

Let's say I have a folder and I set its permissions to 777. After-ward, I move some files or create a new folder into it with permissions 755. How come the added files or folders permissions don't change to 777 which was assigned to the parent? How do I make the parent folder so any new folders/files added to it have the same permissions as that parent folder? Hope that makes sense. Thanks in advance.
User avatar
Flemur
Level 18
Level 18
Posts: 8663
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Folder permissions don't seem to apply to post added items

Post by Flemur »

Benzius wrote:
Sun May 17, 2020 12:29 am
Let's say I have a folder and I set its permissions to 777. After-ward, I move some files or create a new folder into it with permissions 755. How come the added files or folders permissions don't change to 777 which was assigned to the parent? How do I make the parent folder so any new folders/files added to it have the same permissions as that parent folder? Hope that makes sense. Thanks in advance.
The default permissions are defined by umask: https://wiki.archlinux.org/index.php/Umask

Note: "Linux does not allow a file to be created with execution permissions, the default creation permissions are 777 for directories and only 666 for files."
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
rene
Level 16
Level 16
Posts: 6681
Joined: Sun Mar 27, 2016 6:58 pm

Re: Folder permissions don't seem to apply to post added items

Post by rene »

And just to be explicit then:
Benzius wrote:
Sun May 17, 2020 12:29 am
How do I make the parent folder so any new folders/files added to it have the same permissions as that parent folder?
You don't, and as to the "how come" question, why would you expect permissions to be (automatically) recursive? To manually set them recursively use e.g. chmod -R.
Post Reply

Return to “Newbie Questions”