text Chmod权限使用

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text Chmod权限使用相关的知识,希望对你有一定的参考价值。

First digit in the above mode number is used to set setuid, setgid, or sticky bit. Each remain digit set permission for the owner, group, and world as follows:

4 = r (Read)
2 = w (Write)
1 = x (eXecute)
So you end up creating the triplets for your user by adding above digits. For e.g.

To represent rwx triplet use 4+2+1=7
To represent rw- triplet use 4+2+0=6
To represent r– triplet use 4+0+0=4
To represent r-x triplet use 4+0+1=5
To only give full permission to user, use it as follows:
chmod 0700 file.txt

0 – Use set setuid, setgid, or sticky bit
7 – Full permission for owner (rwx = 4+2+1=7)
0 – Remove group permission (— = 0+0+0=0)

以上是关于text Chmod权限使用的主要内容,如果未能解决你的问题,请参考以下文章