# Setting separate default file and directory permissions

**URL:** <https://forums.suse.com/t/setting-separate-default-file-and-directory-permissions/23277>\
**Category:** SLES Configure-Administer\
**Created:** [November 6, 2012, 8:38pm UTC](https://forums.suse.com/t/setting-separate-default-file-and-directory-permissions/23277 "2012-11-06T20:38:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![acunacha](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@acunacha](https://forums.suse.com/u/acunacha)\
**Post date:** [November 6, 2012, 8:38pm UTC](https://forums.suse.com/t/setting-separate-default-file-and-directory-permissions/23277/1 "2012-11-06T20:38:08Z")

</div>

Hi,

This is a quick question, I have tried to find an answer but it’s been unsuccesful.

Is there a way to set different default permissions for files and for directories?

To illustrate better, let’s say I have a /project samba share. I want to configure that share so that new files created in it have the file permissions of 660, and new directories are created with 750.

I have thought of umask, acls, but I dont really know how to accomplish this.

Thanks in advance for your help.

Diego

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 6, 2012, 10:41pm UTC](https://forums.suse.com/t/setting-separate-default-file-and-directory-permissions/23277/2 "2012-11-06T22:41:42Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

Just to be clear, that would allow any files created to be modified by  
anybody who is either the group-owner (and probably the creator if  
that’s the case) or a group-owner (member of the specified group), but  
that would also mean that any directories created could only be  
browsed/read by group-owner members. That may be a little strange,  
since members of the group could modify files created, at the base  
level, but could not create/delete files in any subdirectories because  
the directory permissions did not allow the group-owner to write.

I guess this goes back to: what is your business need here? Maybe it  
is, “Allow modification of files anywhere but only creation by  
group-owners in this subdirectory” but that seems pretty strange without  
an interesting story behind it.

Good luck.  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v2.0.19 (GNU/Linux)  
Comment: Using GnuPG with Mozilla - [http://www.enigmail.net/](http://www.enigmail.net/)

iQIcBAEBAgAGBQJQmXYFAAoJEF+XTK08PnB5esIQANawzNk+j6+8RjAv6ShnpadU  
tXmmAUn7XSwpNiPkIUzLFPMqW6KluwAxCOIYL5Q5lYGFD4SIPzYKFgYAiCgeMhVs  
Ngj3cxUkXfK4XQojZskphJhXgBVA1qg/ZUu2vqHHjtwc3Sgc5kwoGscjPEmaUrwE  
fcXUYEqqXHrJEhU1TnnXJacly/RDXAzR58uKJzxj4jg3/X9ZH7eid9jo7kg+nqHg  
XljK4rls+LGhx5t1bxsLsGzbnufwXjwyZ3CPb8MZmGBzL7kF6trCUQypyYcK1FIS  
r/f6HezdIeqKdManoTCNfw5SVifm2ZzfHf0Kz8ExGOH75W67bKxcT/crCx2YQEyB  
Td4GuNYkcuaXz0XP1ZXYYqD4iOauSJbMPI2/AiqWqrAfwmCj1SGkFHGRpTibc9zr  
d50cD/JxG/9IFNPcxKt2t3mPpEPhoSasYeDbTSyq44ketY+lMuTtdmgMfwN/IeD+  
cVT+OfB1n0HOlCZtMDnW+u8t/wKwfhA6u9zYf8yao1qE8EVPkXDoSOz1XfbuBD/+  
mbE05ZlV+r24g9NHKiexYY3kUmNv0p0v3vdWSjpNz8BkysLtkdrrQOEF/jI8mdzU  
jTTnAxGhSZ4y5b27TsM22KgG4HgSbS0c8hgEHYDR26r57ksXvXAxR0bo/Bs1g7+b  
CWuvCyGVlPsef0Mr7z5r  
=9m4i  
-----END PGP SIGNATURE-----

---

<div class="post-metadata">

**Author:** ![acunacha](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@acunacha](https://forums.suse.com/u/acunacha)\
**Post date:** [November 7, 2012, 9:53pm UTC](https://forums.suse.com/t/setting-separate-default-file-and-directory-permissions/23277/3 "2012-11-07T21:53:16Z")

</div>

Thank you,

It was solved by adding this to the smb.conf share block:

# Mask for new files that are created;

create mask = 0660

# mask for new directories that are created:

directory mask = 0750

Thanks.

Diego
