File Permissions#
File permissions are how we define who can do what with our data. Without them, creating files and therefore storing information on our systems would be risky. Most file permission concepts are the same across multiple operating systems. Only how we manage them changes, but the idea is usually the same.
There are a few key concepts we need to understand to effectively manage permissions at the operating system level. Let's look at a file listing again using ls -la ~
, and we can break down what it is we need to understand to be effective. Here's my listing:
1 2 3 4 5 6 7 8 9 10 11 12 |
|
Note
See how I provided ~
at the end of ls -la
? Try this: ls -la /home
- what's going on here? Simply put, ~
is a shortcut to your user's specific home directory (which doesn't have to be, and may not be, in /home/
.)
Each line cam be broken down into a few key components (ignoring some of the fields for now):
- The group of permissions:
-rw-r--r--
- The ownerships of the file or directory:
michael michael
- The date and time the file (inside of the directory) was last modified:
Mar 18 07:52
- And the file or directory name:
.my_secrets
These are the key concepts we care about the most.
We'll look at each of these concepts, which will use the above file listing to explain and demonstrate how they work.