Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
All seemingly works well; the file is created as evidenced by
> sudo -u user_B ls -l /home/user_B/foo
-rw------- 1 user_B user_B 0 Oct 27 14:52 /home/user_B/foo
The question is: How can I make it happen (assuming I have root access) that when /home/user_B/foo is created, the user_B group automagically has read and write permissions... i.e., the following would happen
> sudo -u user_B ls -l /home/user_B/foo
-rw-rw---- 1 user_B user_B 0 Oct 27 14:52 /home/user_B/foo
Last edited by hopeless_n00b; 10-27-2016 at 05:57 PM.
Reason: hoplessly botched my first attempt at describing the issue
How close does that get you to your goal? The changes there apply only to the directories you choose and then only the users in the designated group would get write access, not all of the users.
I figured out how to edit my question, and so moved the revision (which was here) to the top so that people reading the post would have a more accurate idea of my issue.
Upon following the link in the third post above, I came to appreciate that when user_A executes
> sudo -u user_B touch /home/user_B/foo
it is the umask of user_A that has an influence on the result: if the umask of user_A is 0000 then
> sudo -u user_B ls -l /home/user_B/foo
-rw-r----- 1 user_B user_B 0 Oct 27 14:52 /home/user_B/foo
I remain mystified as to why write access is denied the user_B group (by the way, I did chmod g+s on directories as advised).
Moreover, User_A does not wish to have umask 0000 . Is there a way around that without Access control lists?
Last edited by hopeless_n00b; 10-27-2016 at 03:26 PM.
Reason: making my posts more coherent
The question is: How can I make it happen (assuming I have root access) that when /home/user_B/foo is created, the user_B group automagically has read and write permissions... i.e., the following would happen
> sudo -u user_B ls -l /home/user_B/foo
-rw-rw---- 1 user_B user_B 0 Oct 27 14:52 /home/user_B/foo
The gist is that you set the setGID bit for that directory and that the directory is using a group that user_B is a member of. But depending on your umask, you might have to do other tricks. Try the link in #3 above.
That'll give write access to everybody, not just those in your group. Setting the umask is only incidental to using the right group name and using the SetGID bit. If you do set it, it might be 0002 or something. It is the group and SetGID bit that do the work here.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.