Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
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.
Does anyone know how to set a default umask to a directory or to a group?
It seems you can only set the umask to a user.
I need to set the umask to a particular folder or group would work as well. The umask will be 002.
I'm using g+s already. This sets the defined group ownership to any files/directories created under the parent directory where the g+s was set and works perfectly.
However as for the directory/file permissions, sub directores/files created under the parent do not get the same permissions as the root directory.
I need all the directories to be 775 and files 664 as I need all the members of this particular group to have full permissions to all the files/directories created (no matter who creates it as long as they're in the same group) under the parent directory.
If I could apply the umask of 002 to the group, this would work perfectly.
I guess I can create a cron job to run chmod -R g+w directoryname that will do this but I'd like for this to happen on the fly.
I've seen this requested many times and I've never seen anyone post a solution. I believe it falls in the "can't be done" category. Under linux, users have full control over the files they own, not the filesystem. That's the model.
Whatever you implement will have to be an indirect modification, ie your cron job or some daemon running in the background. it can't be done inherently, afaik.
The soln (I think) in that case would be create a 'user' same name as the group and make the groupuser the owner of the dir. You can then apply the mask to user groupuser. Not sure if that'll work though. Let us know what happens.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.