On Thursday 19 June 2003 17:09, Bret Hughes wrote: > On Thu, 2003-06-19 at 10:41, MKlinke wrote: > > On Thursday 19 June 2003 15:50, Jianping Zhu wrote: > > > i have users u1 u2 u3 > > > > > > I there home directory, u1 u2 u3 have default umask 022 > > > > > > I have a directory d1, and u1 u2 u3 need to have r/w access to > > > d1, i put u1 u2 u3 in group g1 and use "chmod g+s d1", now all > > > file creat by u1 u2 u3 will belong to g1. but when u1 put some > > > file in d1, because his umask is 022, the file has no group write > > > access. but i want u2 u3 also have write access to the file too. > > > how can i achieve this goal? > > > > > > Thanks > > > > This sequence works for me. I think it matches your scenario. Be > > sure you give the group write permission to the directory. > > > > ---------------- > > groupadd testgroup > > useradd uone -p passwd -G testgroup > > useradd utwo -p passwd -G testgroup > > useradd uthree -p passwd -G testgroup > > cd /usr > > mkdir testdir > > chmod 775 testdir > > chmod g+s testdir > > > > login uone > > cd /usr/testdir > > touch testfile.txt > > > > login utwo > > cd /usr/testdir > > vi testfile.txt -change - save > > > > login uthree > > cd /usr/testdir > > vi testfile.txt - change -save > > Doesn't this assume the default non-root user umask of 0002? > > Bret
Interestingly enough, having the three users change their umask settings to 022 ('umask 022') will allow all to modify the file in the directory as above but now there is the accompanying warning about a read-only file. However it can be overriden by forcing the save (w! in vi). It would appear that the umask setting is secondary to the group permission setting, at least in this scenario. Regards, Mike Klinke -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED] https://www.redhat.com/mailman/listinfo/redhat-list