1 Write how to express nix owner permissions of rx in binary
1. Write how to express *nix owner permissions of r-x in binary. (Remember that the symbol means the permission isn\'t granted.) What\'s the octal representation of the binary number you calculated? (The range of numbers expressed in octal is 0 to 7. Because * nix has three sets of permissions, three sets of 3 binary bits logically represent all possible permissions.)
2. In binary and octal numbering, how do you express granting read, write, and execute permission to the owner of a file and no permissions to anyone else?
3. In binary and octal numbering, how do you express granting read, write, and execute permission to the owner of a file, read and write permission to group, and read permission to other?
4. In UNIX, a file can be created by using a unmask, which enables you to modify the default permissions for a file or directory. For example, a directory has the default permission of octal 777. If a UNIX administrtor creates a directory with a unmask of octal 020, what effect does this setting have on the directory? Hint: To calculate the solution, you can subtract the octal unmask value from the octal default permissions.
5. The default permission for a file on a UNIX system is octal 666. If a file is created with a unmask of octal 022, what are the effective permissions? Calculate your results.
Solution
Unix Systems have three user classes as follows:
You can use following octal numbers to choose to represent mode/permission:
a.) r: 4
b.) w: 2
c.) x: 1
1.) For owner permissions in r-x in binary: r+w+x = 100 + 000 + 001 = 1012 = 58
2.) For
So, overall result will be 7008.
3.) For
So, overall result will be 7648.
4.) Given, default permissions = 777 and unmask values = 020
Therefore, result = 777 - 020 = 757 which means owner of the file has read, write and execute permissions; group has only read and execute permissions and others have all permissions as well.
5.) Given, default permissions = 666 and unmask values = 022
Therefore, result = 666 - 022 = 644 which means owner of the file has read, and write permissions; group has only read permissions and others have permissions to read as well.
Hope it helps.
