Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've got both my directory mask and my create mask set to 0777 in my smb.conf file, but for some reason, all the files written in the share are written with 766 permissions. The directories all have 0777 permissions (except the directories directly beneath my share mount point.
Here's my setup: I've got one share mounted, and in the share 6 directories. No one is allowed to write to the share except for in those 6 directories, and group permissions are set to define which users can access which directories. However, if I try to create a file from Windows into one of the directories, the permissions given that file are 766. I'm wondering if this has to do with Samba at all, if mayhap the create mask doesn't take effect because I'm writing to directories beneath the mount point instead of directly beneath it? Any ideas?
create mask sets the maximum permissions that can be set, not the permissions that will be set. What is the umask for the user accounts that are creating the files - you'll probably need to modify that. Also, to keep the group ownership for new files you'll probably have to use the set gid bit on the directories.
I don't set group ownership for new files being created because you can only get into a certain directory containing the files if you're in the group that owns the directory. Anyone that can get into the directories can modify them in any way they want, which is why I'm trying to set the permissions to 777.
As for setting the umask...I'll admit, I'm quite the Linux newbie, and I'm not sure how to set that. Is that something you manually put into one's bash profile, or is there a command that can be used? I know of the umask command, but I'm not sure whether or not you can use that to set permissions for the way the users write their files.
OK, it may be quicker to just add the force create mode and force directory mode options to your samba conf file. They work the way you probably expected create mask and directory mask to work. There's more info at http://us1.samba.org/samba/docs/using_samba/appb.html, but basically:
Code:
force create mode = 0777
force directory mode = 0777
should do what you want - do you need the executable bit set on files? Will 0666 do it just as well?
I don't feel that the executable bit needs to be set. That's my boss' opinion. I don't know that we'll even have executable files on our file server, but it's not really my call.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.