我知道权限是使用 Chmod
设置的,但我很难理解如何将八进制数转换为权限。
例如
640
does this mean that the user hasrw-r----x
permission? Becuase 4+2=6 and 4 = w and 0 = - ?I understand that
777
is wide open because the user has full control fo the file 4+2+1 = 7 rwx permission the group has rwx and the second group has rwx permission If I were to answer this question my answer would be.rw-r----x
What am I doing wrong?
最佳答案
有 3 个数字。第一位是用户权限,第二位是组权限,第三位是其他人的权限。
每个数字都是通过将 4(读取)、2(写入)、1(执行)的子集相加而形成的。
因此6 4 0表示允许用户(6
)读写(4 + 2
),组(4
) ) 允许读取 (4
),其他人 (0
) 没有权限。
关于linux - 使用八进制表示法设置权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32854560/