V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
cicada
V2EX  ›  macOS

os x文件夹权限求解

  •  
  •   cicada · 2013-05-15 15:35:09 +08:00 · 4825 次点击
    这是一个创建于 4021 天前的主题,其中的信息可能已经有所发展或是发生改变。
    由于修改了osx的登录账户(http://support.apple.com/kb/HT1428?viewlocale=zh_CN)
    导致有些在根目录下创建的文件夹无法访问,于是手动将当前用户添加为可读写(command+i)。
    于是ls显示出来之后变成了
    d---r-xr-x+
    最后多了一个加号,google之,说:启用了ACL才会有这个+号,
    有办法取消掉ACL?变成后面没有这个+号?
    10 条回复    1970-01-01 08:00:00 +08:00
    sugarit
        1
    sugarit  
       2013-05-15 15:35:55 +08:00
    试试 磁盘工具->修复权限
    cicada
        2
    cicada  
    OP
       2013-05-15 17:01:41 +08:00
    @sugarit 之前已经试过,但是无效。
    octopus_new
        3
    octopus_new  
       2013-05-15 17:04:14 +08:00
    直接chmod -R 777 [你的目录], 这样就可以吧,你的那个文件件现在用户没有任何rxw权限,组和others有r和x权限,很奇怪.....
    ooxxcc
        4
    ooxxcc  
       2013-05-15 17:12:21 +08:00   ❤️ 1
    try chmod with -N

    from `man chmod`:
    -i Removes the 'inherited' bit from all entries in the named file(s) ACLs.

    -I Removes all inherited entries from the named file(s) ACL(s).

    -N Removes the ACL from the named file(s).
    octopus_new
        5
    octopus_new  
       2013-05-15 17:18:31 +08:00
    @ooxxcc 以前上学的时候就不爱审题,现在依然审题错误,还是你给的答案靠谱,哈哈
    ooxxcc
        6
    ooxxcc  
       2013-05-15 17:39:43 +08:00
    @octopus_new mac的文件权限挺麻烦的,有的时候还会碰到只读flag之类的,到时候你试试chflags

    当时重装系统后为了删除之前的系统文件花了好大功夫。。
    cicada
        7
    cicada  
    OP
       2013-05-15 18:25:47 +08:00
    @ooxxcc 按照你之前的哪个命令将ACL remove掉了。
    然后chown改用户和组。
    最后chomd改权限
    看来更改mac os的用户名是比较烦人。
    ybf1220
        8
    ybf1220  
       2013-05-18 10:55:02 +08:00
    setfacl 试试看,估计原来的 acl 权限你可能已经不知道具体的内容了。
    getfacl 在 linux 下是查看具体权限的
    allenhsu
        9
    allenhsu  
       2013-05-19 16:41:54 +08:00
    sudo chown & chmod 也不管用么?(-RF)
    dorentus
        10
    dorentus  
       2013-05-19 21:02:31 +08:00
    @ybf1220 Mac 下没带这两个命令。4 楼的内容是正解。添加/修改 ACL 也是用的 /bin/chmod。

    ref: https://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man1/chmod.1.html
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1067 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 23:14 · PVG 07:14 · LAX 16:14 · JFK 19:14
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.