Jump to content

Groups and permissions


phunni
 Share

Recommended Posts

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 :thanks: )

 

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...

Link to comment
Share on other sites

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....

Link to comment
Share on other sites

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 by adamw
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...