Archive for the ‘Permission’ Category
Umask and sticky bit
1. File and directory permission
rwxrwxrwx — 777
r — 4
w — 2
x — 1
ugoa — user, group, other, all
2. Set umask
Preset the permission for files and directories to be created.
# umask — show the umask value
777 – umask —> for directories
777 – umask – 111 —> for files
3. Set sticky bit
- SUID — 4, GUID –2, Sticky — 1
- Sticky bit — a “t” at the end of others, for the directories, only the owner can delete files under that directories
— if “x” missing, “t” becomes “T”
# chmod 1777 dir1
# chmod +t dir2
# chmod o+t dir3
- SUID — a “s” at the end of owner, for script, who run the script would act as the script owner
— if “x” missing, “s” becomes “S”
# chmod 4777 file1
# chmod u+s file1
- SGID — a “s” a the end of group, for files. action as the group users
— if “x” missing, “s” becomes “S”
# chmod 2777 file1
# chmod g+s file2
Categories: Permission
This web site has been moved to http://www.holediscover.com.
And there would be no further updates here later.
Thanks for visiting and welcome to the new site.
History
M | T | W | T | F | S | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |