I've read countless articles on the topic and searched through every question and answer I could find without any luck. I'm slowly going mad so I'm turning to you guys since I know the answer to my question is most likely simple.
On my web server, I have two users and two groups. The users need to read and write to the same area. Not a single folder, but a complex network of folders.
>> groups user_1 popuser psaserv psacln >> groups user_2 psacln popuser psaserv
These aren't real users so they don't have .bashrc files. When each of the users creates a directory, the permissions look exactly how I'd expect:
drwxr-xr-x 2 user_1 popuser 4096 Apr 30 20:47 folder_1 drwxr-xr-x 2 user_2 psacln 4096 Apr 30 20:49 folder_2
But once one of the two users creates the folder, the other is unable to write any files to it.
If I chmod 777, then of course they can both write.
Also unusual is that when a file is written into the group, the permissions seem very restrictive:
-rw-r--r-- 1 user_2 psacln 0 Apr 30 21:15 some_file.ext
Although maybe that's expected.
Anyway, to sum up and clarify my two part question:
1) How can I make both users access files and folders from each other, given their group differences? 2) How can I set the default permissions on new files so they inherit the folder permissions?
(2) I've tried adding umask 022 into my ~/.bashrc file for my root user, but it didn't do anything. I'm unsure where to put that for these "users" who don't have home directories.
Sorry, I know questions like this can feel redundant for you Linux user experts. Searching is difficult when I don't even know what I'm looking for.
Thanks so much, as always.
[I'm on centOS]