cuthead
V2EX  ›  macOS

分区根目录的权限默认应该是怎么样的?

  •  
  •   cuthead · May 1, 2015 · 2587 views
    This topic created in 4070 days ago, the information mentioned may be changed or developed.
    里面权限是不同的,到底哪个才是对的?
    10 replies    2015-05-02 18:44:07 +08:00
    Autonomous
        1
    Autonomous  
       May 1, 2015
    对于已启用所有者的宗卷,其宗卷根目录的
    所有者为root:wheel
    权限应为755
    ItzhacLea
        2
    ItzhacLea  
       May 1, 2015
    第三个是最接近的,但即使如此,wheel 的权限也仅为read only
    cuthead
        3
    cuthead  
    OP
       May 1, 2015
    @Autonomous
    @ItzhacLea 怎么用Terminal修正这个问题?
    popbones
        4
    popbones  
       May 1, 2015
    @cuthead man chmod
    Autonomous
        5
    Autonomous  
       May 1, 2015   ❤️ 1
    @cuthead
    sudo chown -R root:wheel #file destination#
    sudo chmod -R 755 #file destination#
    Autonomous
        6
    Autonomous  
       May 1, 2015
    @cuthead before you apply those commands, disable 'Ignore ownership on this volume' is required.
    cuthead
        7
    cuthead  
    OP
       May 1, 2015
    @Autonomous 如何显示分区的permission和ownership?ls -l只显示文件列表的权限。中间图显示组成员是staff是怎么回事?为什么可以同时用system和user的个人权限?如何改权限的人的名字用Terminal
    Autonomous
        8
    Autonomous  
       May 1, 2015   ❤️ 1
    @cuthead 首先要保证宗卷被正常挂载,然后cd /volumes
    接着ls -al就可以看到相关宗卷的所有者/所有者所在的组/对应权限。
    chown命令用于更改所有者:所有者对应的组。 因为一个用户可以隶属于多个组,所以除了指定所有者外还要指定一个组。一般来说宗卷根目录是由root账户和wheel组所有。因此sudo chown -R root:wheel

    chmod命令用于修改权限,7表示rwx(即读写+执行),5表示r-x(直读+执行)。
    Autonomous
        9
    Autonomous  
       May 1, 2015
    5楼的命令有一个错误! 我不应该加-R的,这里用递归会导致整个宗卷包括其子文件夹/文件都会被改掉权限。其实应该仅应用于宗卷根目录即可。
    cuthead
        10
    cuthead  
    OP
       May 2, 2015
    @Autonomous 问题解决,多谢解答,原来还得改所有者。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   951 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 19:21 · PVG 03:21 · LAX 12:21 · JFK 15:21
    ♥ Do have faith in what you're doing.