Linux - Security This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
09-16-2009, 09:06 PM
|
#1
|
LQ Newbie
Registered: Sep 2009
Posts: 12
Rep:
|
set default umask to a directory or a group
Hi all,
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.
|
|
|
09-16-2009, 09:41 PM
|
#2
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,415
|
I don't think so...
What are you trying to achieve?
If you want a shared dir, use: chmod g+s dirname
http://ss64.com/bash/chmod.html
|
|
|
09-17-2009, 01:52 PM
|
#3
|
LQ Newbie
Registered: Sep 2009
Posts: 12
Original Poster
Rep:
|
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.
|
|
|
09-17-2009, 02:29 PM
|
#4
|
Member
Registered: Aug 2003
Location: Seattle
Distribution: ubuntu, lately
Posts: 182
Rep:
|
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.
|
|
|
09-17-2009, 09:54 PM
|
#5
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,415
|
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.
|
|
|
All times are GMT -5. The time now is 03:16 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|