How to share files/folders ?
I've create a share partition (/mnt/sharing , ext3) on a desktop computer that is used by several users.
All users is having a common group "users" However, when a user creates a file in the common folder, the file permissions is Quote:
Quote:
|
Put the following in each user's .bashrc:
Code:
umask 0002 See man bash for how umask works. |
chmod g+w file would also work
002 is -------w- you would want 660 to get rw-rw---- the default rw-r--r-- is 644 of course umask perhaps works in reverse of this? |
I think he wanted it so that rw-rw-r-- was the default, without having to chmod each new file. I should mention that my advice only applies if every user's login shell is bash (this is the usual). If they use different shells it'll be some other file you need to edit, hopefully the manpage will say which one.
I've just experimented and this may not work for other programs - I've changed my umask at the command line but gedit is still creating files with the old permissions. Possibly you need to log out and log back in again before it takes effect everywhere - let us know if you do this and it's still not working. And thinking about it, this may not be exactly what you want - the umask applies to all newly created files, so new files in the users' home dirs will also be rw-rw-r--. There are a couple of different ways around this:
Unfortunately there doesn't seem to be any way to get new files to simply inherit permissions from their parent directory. Well, I saw something called "ACLs" in another post, but don't know how they work - look into them if you want. @frieza: yes, umask inverts the octal permissions, "masking" the bits you don't want. Don't ask why! :rolleyes: |
All times are GMT -5. The time now is 07:04 AM. |