How to Set File Permissions in Linux?
Setting file permissions in Linux is a fundamental task for managing access to files
and directories. Proper file permissions ensure that only authorized users can read,
write, or execute files, enhancing the security and functionality of your system.
There’s a lot of information in those lines.
1. The first character = ‘-‘, which means it’s a file ‘d’, which means it’s a directory.
2. The next nine characters = (rw-r–r–) show the security
3. The next column shows the owner of the file. (Here it is `root`)
4. The next column shows the group owner of the file. (Here it is `root` which has
special access to these files)
5. The next column shows the size of the file in bytes.
6. The next column shows the date and time the file was last modified.
7. Last Column = File_name or Directory_name. (For example, here are: prac,
snap, test, example)
How to Change Permissions in Linux?
The command you use to change the security permissions on files is called
“chmod“, which stands for “change mode” because the nine security characters are
collectively called the security “mode” of the file.
SYMBOLIC METHOD
Example:
NUMERIC METHOD
There can be numerous combinations of file permissions you can invoke revoke
and assign. You can also use octal notations like this.
NOTE: ALSO REFER CLASS NOTES