-
On Linux, every file has three levels of permissions

-
The file will contain a file type before permission levels and sticky bit at the end if it is set up. This is to prevent anyone but the owner from deleting the file
-
Types of File Types
-
- : normal file that can contain data of any kind
- d: directory contains other files or directories and helps to organize the file system (technically special)
- l : file is a pointer to another file or directory elsewhere in the filesystem
- b for block, c for character, s is for socket (these are mentioned but indicated to be outside of scope ) - These are the file types that should not be altered unless you know what you are doing as it will prevent the system from working
-
Types of permissions
- read : permission to open a file and read its contents. It has an octal level of 4
- octal levels are required when adjusting the level of permissions for a file type and you want to do it numerically
- write : permission to edit or delete a file. It has an octal level of 2
- execute : permission to run as an executable or script. It has an octal level of 1
-
If the permissions are on a directory, it contains slightly different meanings
- Reading allows you to read the directory not the files within the directory
- write allows you to create or delete files in a directory, or change their names, permissions, and owners
- executable provides entering into the directory, but not the list of its files as r is required
-
chmod is used to modify permissions and it can be done numerically or symbolic mode
- symbolic options
- you must identify what type of permission you are changing and what location (user, group, or others)
- u - user
- g - group
- o - other
- a - all
- +/- based on whether the permission is being added or removed
- rwx or a combination of them is put in based on what is added or removed
- , can be used when modifying multiple permissions at the same time
- -R - recursively means that all files inside a directory and its subdirectories
.png)
-
groups command determine what groups exist on the system
-
groupmems determines who is within a specific group