phunni Posted September 29, 2004 Report Share Posted September 29, 2004 Yesterday I set up a directory called /shared and gave a group called shared ownership of it. I then put myself and my wife in the group and gave us full access permissions (with some help from fissy on #musb ) My only query now is can I set it up so that any files created or modified automatically belong to the shared group? As it stands, anything I create or my wife creates seems to belong to that specific user - thus reducing the full access I'd like us to both have... Hope the question makes sense... Quote Link to comment Share on other sites More sharing options...
arctic Posted September 29, 2004 Report Share Posted September 29, 2004 i`d say, as long as you add your wife to your user group (rights) and your account to her user group, it should be possible. and even if both belong to a group (e.g. "shared), both should be able to edit the files.... i guess.... Quote Link to comment Share on other sites More sharing options...
adamw Posted September 29, 2004 Report Share Posted September 29, 2004 (edited) if you use the ext2 or ext3 filesystem for the drive, you can specify mount options which will do what you require - assign certain user, group and permissions to all files created on the drive. read the mount manpage for more info, or i can look it up myself later today when i'm back in front of a linux box. Once you've grokked the options, add them to /etc/fstab and they'll be used always. Edited September 29, 2004 by adamw Quote Link to comment Share on other sites More sharing options...
phunni Posted September 29, 2004 Author Report Share Posted September 29, 2004 I use reiserfs... Quote Link to comment Share on other sites More sharing options...
aRTee Posted September 29, 2004 Report Share Posted September 29, 2004 What if you make that dir and subdirs rwxrwxr.x and owner and group 'shared'..? Shouldn't that automatically lead to files getting created only being of the shared group? Quote Link to comment Share on other sites More sharing options...
aperahama Posted September 29, 2004 Report Share Posted September 29, 2004 I have something similar. I have set up a group called "money" that my wife and I have access to but the children don't. I made myself and my wife members of the group and set up a directory with permissions rwxrwx---. This means we can both access the information yet our children cannot access the the directory. This works well for me as we both access the same GnuCash files. Quote Link to comment Share on other sites More sharing options...
adamw Posted September 29, 2004 Report Share Posted September 29, 2004 what artee says will apply, though it doesn't help when you make a new directory... also, you could always use a lazy option, which is to go to the root of the partition and issue a: chown -R desireduser.desiredgroup * which will do the job. inelegant but effective. you could even script it. :) Quote Link to comment Share on other sites More sharing options...
phunni Posted September 30, 2004 Author Report Share Posted September 30, 2004 adamw that's what I have been doing, but I'd rather find a less geeky solution which my wife can use - or prefereably not even have to worry about... Quote Link to comment Share on other sites More sharing options...
theYinYeti Posted September 30, 2004 Report Share Posted September 30, 2004 In theory, setting the suid bit on a directory leads to anything inside being of the same user and group. So in theory, this should answer your need: # chown -R shared.shared /shared # find /shared -type d -exec chmod 6770 {} \; This is what I've done for my wife and me. But: - One thing I'm sure of: root files remain root files, no matter what. - I'm not sure that new subdirectories are affected. Chances are that even IF new subdirectories have the good user and group, those probably won't have the suid bits themselves, leading in "sub-files" owned by their creators. - I'm not even sure it even work anyway... :D Yves. Quote Link to comment Share on other sites More sharing options...
paul Posted September 30, 2004 Report Share Posted September 30, 2004 umask: the permission subtracted from 777 exmaple: you want 770 permission then 777 - 770 = 007 set your umask to 007 I think you'll find it in one of the following locations /etc/profile /etc/profile.env ~/.bash_profile but be warned this has global consequences .. every file you create will have these permsissions you could setup samba with umask 007, then mount /share with samba smb://localhost/share then the umask would only affect the samba mount Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.