# Default file (and folder) permissions on Create

**URL:** <https://help.nextcloud.com/t/default-file-and-folder-permissions-on-create/1958>\
**Category:** ℹ️ Support\
**Created:** [July 27, 2016, 10:59am UTC](https://help.nextcloud.com/t/default-file-and-folder-permissions-on-create/1958 "2016-07-27T10:59:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Schultz-IT-Solutions](https://help.nextcloud.com/letter_avatar/schultz-it-solutions/32/5_5575768a8748004e209b776fc1b2916d.png) [@Schultz-IT-Solutions](https://help.nextcloud.com/u/Schultz-IT-Solutions)\
**Post date:** [July 27, 2016, 10:59am UTC](https://help.nextcloud.com/t/default-file-and-folder-permissions-on-create/1958/1 "2016-07-27T10:59:33Z")

</div>

Hello community,

As far as I understand, when adding a new folder or document (through whatever instrument), they are created with “chmod 0755” for the folder and “chmod 0644” for the file.

In our environment, I would like to further restrict the access by restricting both to “chmod 0700” (e.g. manipulatable ONLY by the “fileOwner” which in our case is sufficient.  
I tested the consequences with the “web interface”, the “webdav connection” and the “sync application - for windows”, and all can perfectly access these restricted files.

So my question is: Is there any place where we could “set the default permissions to 0700” for newly created folders and files?

thanks for any guidance here…

---

<div class="post-metadata">

**Author:** ![rullzer](https://help.nextcloud.com/user_avatar/help.nextcloud.com/rullzer/32/840_2.png) [@rullzer](https://help.nextcloud.com/u/rullzer)\
**Post date:** [July 27, 2016, 11:28am UTC](https://help.nextcloud.com/t/default-file-and-folder-permissions-on-create/1958/2 "2016-07-27T11:28:27Z")

</div>

I’m not sure we set it explicitly (@icewind ?)

However if you restrict your datafolder to 700 then already on the FS level only the owner could cd into it.

---

<div class="post-metadata">

**Author:** ![Schultz-IT-Solutions](https://help.nextcloud.com/letter_avatar/schultz-it-solutions/32/5_5575768a8748004e209b776fc1b2916d.png) [@Schultz-IT-Solutions](https://help.nextcloud.com/u/Schultz-IT-Solutions)\
**Post date:** [July 27, 2016, 11:38am UTC](https://help.nextcloud.com/t/default-file-and-folder-permissions-on-create/1958/3 "2016-07-27T11:38:24Z")

</div>

@rullzer: thanks for the reply.

As per the “datafolder” remark, I found this

> <https://unix.stackexchange.com/questions/139144/permissions-under-a-700-rwx-directory>

  
(see garethTheRed 's answer:  
If you create a file underneath /foo/bar/baz which is readable by others and then create a hard link to this file in an accessible path, they’ll be able to read it regardless of the permissions on /foo/bar/baz.

So setting the DATAROOT directory is not “fully” satisfactory in this respect…

@icewind:  
If NextCloud (server) does not set the permissions, then proabably the PHP default will be taken. However, in that circumstances it might be a nice idea to let the ADMIN decide on this

(or I could simply add that code to our implementation, if you help me find the right spot(s))

---

<div class="post-metadata">

**Author:** ![Bullnados](https://help.nextcloud.com/letter_avatar/bullnados/32/5_5575768a8748004e209b776fc1b2916d.png) [@Bullnados](https://help.nextcloud.com/u/Bullnados)\
**Post date:** [March 22, 2017, 7:46am UTC](https://help.nextcloud.com/t/default-file-and-folder-permissions-on-create/1958/4 "2017-03-22T07:46:49Z")

</div>

Is here something planed? I mean setting the permissions more restrective to increase the security but not at cost of usability?  
Atm the data folder will set to 770 but subfolders to 750.

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [November 6, 2024, 8:57pm UTC](https://help.nextcloud.com/t/default-file-and-folder-permissions-on-create/1958/5 "2024-11-06T20:57:41Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 4, 2024, 3:13pm UTC](https://help.nextcloud.com/t/default-file-and-folder-permissions-on-create/1958/6 "2024-12-04T15:13:51Z")

</div>


