You are not logged in.

#1 2018-03-08 17:17:49

turekpolski
Member
From: Poland
Registered: 2011-05-11
Posts: 28

[SOLVED] chmod 2770 not working as expected...

Situation:
Users "jack" and "jill" both belong to a group "project"

A shared location /srv/shared was created with permissions set as follows:

#mkdir /srv/project_folder
#chgrp -R project /srv/shared
#chmod -R 2770 /srv/shared

Now the thing is that both jack & jill can create a new folder in the /srv/shared folder, but as soon as one of them does, the other one cannot create anything inside it. ls shows, that the folder is owned by the user that created it and it belongs to the group "project" so it's all OK but still the other user doesn't have permission to create something inside.

What am I doing wrong?

Last edited by turekpolski (2018-03-08 18:11:21)


Registered Linux User #511180

Offline

#2 2018-03-08 17:36:37

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,463

Re: [SOLVED] chmod 2770 not working as expected...

That sounds right. With a default umask of 022, a dir created will be 755, which does not give the group permission to write to it.

Offline

#3 2018-03-08 17:44:06

turekpolski
Member
From: Poland
Registered: 2011-05-11
Posts: 28

Re: [SOLVED] chmod 2770 not working as expected...

Thanks Scimmia, I missed the umask in my thinking.

So If I want it for both jack & jill to be able to create files and folders available and editable for each other in the group in that /srv/shared I need to either switch the umask to 002 (sounds bad as it'll not apply to this folder alone) or manually chgrp/chmod everytime anything is created there?

Is there no easier way? In the past I just had a ntfs partition shared between users but I want to go "all-linux" now and I'm stuck.


Registered Linux User #511180

Offline

#4 2018-03-08 17:54:46

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,463

Re: [SOLVED] chmod 2770 not working as expected...

ACLs should be able to do what you want, I believe.

Offline

#5 2018-03-08 18:09:42

turekpolski
Member
From: Poland
Registered: 2011-05-11
Posts: 28

Re: [SOLVED] chmod 2770 not working as expected...

Worked like a charm. Thanks Scimmia! I'm marking this as solved.


Registered Linux User #511180

Offline

Board footer

Powered by FluxBB