Changes

Jump to: navigation, search
File Permissions
When '''directories''' and r'''egular files''' are created, they are assigned to an '''owner'''<br>(typically the username which is the creator).
To ''allow'' or ''limit'' '''access''' to those<br>files and directories, those files and directories are assigned to an <br>initial '''group''' referred to as a "'''primary group'''". Users that <u>own</u> those ''directories'' and ''regular files'' are referred to as '''users''', users that belong within<br>the <u>same group</u> are referred to as '''same group members''', and those users that<br>do <u>NOT</u> belong to a particular group are referred to as '''other group members'''.
[[Image:directory-permissions.png|thumb|right|350px|Permissions of a '''directory''' that contain subdirectories and regular files.]]
Users that <u>own</u> those ''directories''NOTE:and ''regular files' In this course, we CANNOT create groups or assign users ' are referred to groups in the as '''Matrixusers''' server., users that belong within the <bru>Instead, you may learn how to those tasks when or if you take a Unixsame group</Linux administration course.<bru>On the other hand, you can change which '''user''', are referred to as '''same group members''' or , and those users that do <u>NOT</u> belong to a particular group are referred to as '''other group members'''<br>can access or NOT access a directory or regular file.<br><br>
'''NOTE:''' In this course, we CANNOT create groups or assign users to groups in the '''Matrix''' server. Instead, you may learn how to those tasks when or if you take a Unix/Linux administration course. On the other hand, you can change which '''user''', '''same group members''' or '''other group members''' can access or NOT access a directory or regular file.<br><br>
[[Image:file-permissions.png|thumb|right|350px|Permissions of a '''regular file''' contained within a directory.]]
File Permissions consist of '''two-layers''':<br><br>'''First''', the permissions of a '''directory''' that contains regular files, and '''second''', permissions of the ''subdirectories and/or regular files'' within that directory.
A symbol ''dash'' "'''-'''" indicates that the permission has '''NOT''' been granted.
[[Image:file-permissions.png|thumb|right|350px|Permissions of a '''regular file''' contained within a directory.]]The permissions of '''newly-created''' directories and regular files are automatically assigned<br>via a '''user mask''' (we will discuss this shortly). In order to change permissions for <br>directories and regular files, you would use the '''chmod''' command.
'''Changing File Permissions with "chmod" command:'''
[[Image:symbolic-chart.png|thumb|right|550px|Examples of adding, removing and setting permissions using the '''chmod''' command with the '''Symbolic''' method.]]
 
'''<span style="font-style:italic">Symbolic Method:</span>'''
The chmod can use '''symbols''' to ''add'', ''remove'', and ''set'' <span style="font-family:courier;font-weight:bold;">rwx</span> permissions for the '''user''',<br>'''same group members''', and/or o'''ther group members''' for a directory or reqular file.
 [[Image:symbolic-chart.png|thumb|left|550px|Examples of adding, removing and setting permissions using the '''chmod''' command with the '''Symbolic''' method.]]<br><br><br><br><br><br><br><br><br><br><br>
'''<span style="font-style:italic">Octal (Absolute) Method:</span>'''
[[Image:octal-permissions.png|thumb|right|150px|Using octal numbers to represent setting file permissions.]]
Since 1 octal digit represents 3 binary digits, one octal digit can represent the <span style="font-family:courier;font-weight:bold;">rwx</span> permission granted or NOT granted. The permissions '''rwx''' are be in the form of 3 binary digits (1 represents the permission granted and 0 represents the permission NOT granted).
[[Image:absolute-chart.png|thumb|left|550px|Examples of adding, removing and setting permissions using the '''chmod''' command with the '''Absolute / Octal''' method.]]
<br><br><br><br><br><br><br><br><br>
'''NOTE:''' You can use the '''-R''' option to set permissions for directory, subdirectory and directory contents '''recursively'''.
  <table align="right"br><trbr><td>[[Image:umask-directory.png|thumb|right|200px|Setting '''umask''' for newly-created '''directories'''.]]</td><td>[[Image:umask-file.png|thumb|right|200px|Setting '''umask''' for newly-created '''regular files''']]</td></tr></tablebr>
'''Setting Permissions for Newly-Created Directories and Regular Files (umask):'''
<table align="right"><tr><td>[[Image:umask-directory.png|thumb|right|150px|Setting '''umask''' for newly-created '''directories'''.]]</td><td>[[Image:umask-file.png|thumb|right|150px|Setting '''umask''' for newly-created '''regular files''']]</td></tr></table>
The '''umask''' command is used to set the permissions of newly-created directories and regular files.
 
Issuing the '''umask''' command without arguments will display the current umask value.
13,420
edits

Navigation menu