Advanced Linux
File Permission
Access Control
- Dr. John Yoon
Access Control Dr. John Yoon How do you know yours? Finding about - - PowerPoint PPT Presentation
Advanced Linux File Permission Access Control Dr. John Yoon How do you know yours? Finding about you and the system $ who $ hostname $ whoami $ uname $ id $ date $ ps -aux Environment Variables Environment Settings of a
$ who $ hostname $ whoami $ uname $ id $ date $ ps -aux
$ printenv $ printenv TERM $ py3=python3 $ export py3 $ echo $py3 $ unset py3
Think of the pipe as a way of connecting the output from one command to the input of another command.
more complex tasks that would otherwise take multiple steps (and possibly writing information to disk).
required by the kill command.
specified by the process_id (PID).
command "kill -9 process_id" sends a kill signal to the process.
Access Control Check
A Request Allow / Deny The Policy
and execute permissions to the user (owner of file), group (same group members) or all others (different group members)
chmod [who] [operation] [permission] file
setting (=) permissions
User User User Type (Subject) Type (Object) Object Object Object Permission Assignment Subject Type Can Access Object Type To Perform Operations On Objects
chmod g+rw file.name chmod o+x file.name
chmod g-w file.name chmod a-w file.name (removes write for ug)
chmod o=rx file.name chmod go=rx filename
Possible additive bits 1 2 1+2 = 3 4 1+4 = 5 2+4 = 6 1+2+4 = 7
Can execute Can write Can execute and write Can read Can execute and read Can write and read Cal do all
chmod ___ file - r w x r w x r w x chmod ___ file - r w x r - x r - x chmod ___ file - r w x - - x - - x chmod ___ file - r w - r - - r - -
Q: Fill in the number
umask [mask] where mask represents a 3-digit octal number for permissions to be denied for UGO.
from the system.
Example:
r w x r - - r - -
1 1 1 1 0 0 1 0 0 = 744
Why 777? Because the system wants to give full permissions for user, group and others. The mask 033 takes away the specified permissions.
Example:
r w x r - - r - -
r w - r - - r - -