Professional Documents
Culture Documents
other
user john (owner)
have rights rwx:
(r) read directory content
(w) write/add/erase directory content
(x) execute/enter directory
group scientists have rights rx:
(r) read directory content
(x) execute/enter directory
other: besides user john and group
scientists have no rights at all
directory
Version 1.0 linuxslides.blogspot.com
3.1 Reading file permission
other
user john (owner)
have rights rwx:
(r) read file content
(w) write/add/erase file content
(x) execute a file
group scientists have rights rx:
(r) read file content
(x) execute a file
other: besides user john and group
scientists have no rights at all
file
Version 1.0 linuxslides.blogspot.com
3.3 File and directory permissions
Directory File
Answers:
User root have rights?
Group shadow have rights?
Besides user root and group shadow have rights?
Answers:
User john have rights?
Group scientists have rights?
Besides user and group have rights?
Answers:
Which part is responsible for deleting a file?
File permissions or directory permissions?
What permissions should be added? Where? User, group or
other?
suid
--s --- --- chmod u+s file chmod 4xxx file
(set user id)
sgid
--- --s --- chmod g+s file chmod 2xxx file
(set group id)
sticky bit --- --- --T chmod +t file chmod 1xxx file
From above we can see that the default permission for file is 644, and for
directory is 755.
Version 1.0 linuxslides.blogspot.com
7.1 Change Umask
The change above is temporarily, when computer restart it will change back to
0022. If we want to change permanently, define the umask value inside
/etc/profile.