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.
but i have another problem when i create a subdirectory within the main directory for which i have set the above perms i am able to delete it, it does not get the same permissions
anyway you should be able to set the smb.conf options
directory mask = 1777
create mask = 1777
force user=root
to acheive this effect.
AFAIK the sticky bit allows only the ownder of the directory to delete it so in this case if you created it you could delete it, but no one else could. The above force user option means all files/dir's are created as if from that user so use root or some other uid that is not normally used.
oops so it does, I had never used it and hadn't really thought that through. I guess you could run a script to change the owner or each directory and put the script into cron but that is a bit kludgey, besides it is possible for the directory to be quickly created and deleted in this way anyway. I will have to have a closer look
This parameter specifies a set of UNIX mode bit permissions that will always be set on a file created by Samba. This is done by bitwise 'OR'ing these bits onto the mode bits of a file that is being created or having its permissions changed. The default for this parameter is (in octal) 000. The modes in this parameter are bitwise 'OR'ed onto the file mode after the mask set in the create mask parameter is applied.
See also the parameter create mask for details on masking mode bits on files.
See also the inherit permissions parameter.
Default: force create mode = 000
Example: force create mode = 0755
would force all created files to have read and execute permissions set for 'group' and 'other' as well as the read/write/execute bits set for the 'user'.
Now all you have to do is take a closer look at the smb.conf(5) man page
the problem is that the user that owns the directory/file has write permission and therefore can delete, this is the original problem jayakrishnan was trying to get around. We have already discussed useing the create mask's to set the sticky bit but this still does not help if the person trying to delete owns the file.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.