关于通过owner/group/other模型实现A读写B只读权限的设置咨询
Answer to Permission Configuration Question
Absolutely! The Unix/Linux owner/group/other permission model is perfectly designed to handle this exact requirement. Let’s walk through every part of your question clearly:
Core Feasibility
Yes, this setup is fully achievable using the standard owner/group/other permission model—no extra tools or workarounds needed.
Detailed Configuration Breakdown
Let’s map your requirements directly to the permission model:
- File owner: Set this to User A. As the owner, User A gets a dedicated permission set independent of group or other permissions, making it easy to grant full read/write access.
- File group: Create a new dedicated group (e.g.,
doc-collab-group) and add only User B to it. You don’t need to include User A here—since they’re the owner, their permissions are already separate, and adding them to the group would just be unnecessary clutter. - User A’s permissions: Assign the owner permission set to
rw-(read + write, numeric value6). This gives User A full edit access to the file. - User B’s permissions: Assign the group permission set to
r--(read-only, numeric value4). Since User B is in the file’s group, they’ll inherit this read-only access automatically. - Other permissions: Set this to
---(no access, numeric value0). This ensures any user who isn’t User A or in the dedicated group can’t view or modify the file at all.
Step-by-Step Command Examples
Here’s how to implement this in practice (replace placeholders with your actual usernames and file path):
- Create the dedicated group:
sudo groupadd doc-collab-group - Add User B to the group:
sudo usermod -aG doc-collab-group userB - Set the file’s owner and group:
sudo chown userA:doc-collab-group /path/to/target/file - Apply the correct permissions:
sudo chmod 640 /path/to/target/file
Quick Tip
If you’re configuring permissions for a directory (and all its contents), add the -R flag to the chown and chmod commands to apply changes recursively:
sudo chown -R userA:doc-collab-group /path/to/target/directory sudo chmod -R 640 /path/to/target/directory
内容的提问来源于stack exchange,提问作者sam jackson
相关产品推荐
相关产品推荐

