group and file rw permissions
Hi All,
With the help of setfacl and chmod 2770 I have been able to accomplish half of my goal. My goal: have twoo separate users write to a group specific directory where new files created by either user will be rw-rw----. Currently, when either user creates a file is reads: rw-r--r--. Not what I want. Any help would be greatly appreciated. |
You want to use the umask utility to set the default file creation permission. This is done when a user account logs in. The log in process involves automatically running some scripts that set up the user's environment. These files include but are not limited to /etc/bashrc and /etc/profile. Different distributions do this in different ways. My distribution has a directory /etc/profile.d with a bunch of scripts. Then the file /etc/profile runs all of the scripts in the /etc/profile.d directory. So I created a file called /etc/profile.d/z-myprofile.sh to set the umask and any other things that I want to do to a user's environment. This is the code to set the umask to what you want.
Code:
umask 027 |
Thanks a lot for your help.
I'm curious though, from what I understand, changing the umask in the etc/profile it will affect all users. Is this correct? Is there a way to use umask for certain users on a particular directory? |
Quote:
Code:
test "`groups | grep mygroup`" && umask 027 |
All times are GMT -5. The time now is 06:24 AM. |