jueves, 26 de septiembre de 2013

LInux File Permissions

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)
    0 - Remove world permission (--- = 0+0+0=0)



http://www.cyberciti.biz/faq/unix-bsd-linux-setuid-file/

No hay comentarios:

Publicar un comentario