You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

关于通过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 value 6). This gives User A full edit access to the file.
  • User B’s permissions: Assign the group permission set to r-- (read-only, numeric value 4). 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 value 0). 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):

  1. Create the dedicated group:
    sudo groupadd doc-collab-group
    
  2. Add User B to the group:
    sudo usermod -aG doc-collab-group userB
    
  3. Set the file’s owner and group:
    sudo chown userA:doc-collab-group /path/to/target/file
    
  4. 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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 10:32:57