Hello! Last week, I thought I knew how users and groups worked on Linux. Here is what I thought:
- Every process belongs to a user (like
julia
) - When a process tries to read a file owned by a group, Linux a) checks if the user
julia
can access the file, and b) checks which groupsjulia
belongs to, and whether any of those groups owns & can access that file - If either of those is true (or if the ‘any’ bits are set right) then the process can access the file
So, for example, if a process is owned by the julia
user and julia
is in the awesome
group, then the process would be allowed to read this file.
r--r--r-- 1 root awesome 6872 Sep 24 11:09 file.txt
Read more at Julia Evans