You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many new users come to Linux every day, and using AlmaLinux for the first time should be as simple as possible! This serie attempts to explain some of the base level conecepts in simple language so new users won't get immediately overwhelmed.
9
-
10
-
-[File and Folder Permissions on AlmaLinux](file-and-folder-permissions.md)
9
+
Many new users come to Linux every day, and using AlmaLinux for the first time should be as simple as possible! This serie attempts to explain some of the base level conecepts in simple language so new users won't get immediately overwhelmed.
11
10
11
+
-[File and Folder Permissions on AlmaLinux](file-and-folder-permissions.md)
12
12
13
13
# Up next!
14
14
15
15
Once you've completed these guides, take a look at any of the other guides that interest you!
16
16
17
17
-[Nginx - from beginning to configured!](/series/nginx/)
18
-
-[AlmaLinux System Series - various ways to interact with your AlmaLinux environment](/series/system/)
18
+
-[AlmaLinux System Series - various ways to interact with your AlmaLinux environment](/series/system/)
Copy file name to clipboardExpand all lines: docs/beginners/file-and-folder-permissions.md
+28-26Lines changed: 28 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,12 @@
1
1
---
2
2
title: "File and Folder Permissions"
3
3
---
4
+
4
5
<hr>
5
6
6
-
| 💡 | Experience Level | ⭐☆☆☆☆ |
7
-
|--- | --------- | --------|
7
+
| 💡 | Experience Level | ⭐☆☆☆☆ |
8
+
| --- | ---------------- | ------ |
9
+
8
10
###### last updated: 2024-09-10
9
11
10
12
# Introduction
@@ -17,22 +19,22 @@ And because Linux is a multi-user operating system, file and folder permissions
17
19
18
20
There are two different methods for changing folder and file permissions on Linux:
19
21
20
-
-absolute - which requires users to know the numeric number associated with each permission.
21
-
-symbolic - which only requires the use of letters associated with users (user, group, and other) and permissions (such as read, write, and execute).
22
+
- absolute - which requires users to know the numeric number associated with each permission.
23
+
- symbolic - which only requires the use of letters associated with users (user, group, and other) and permissions (such as read, write, and execute).
22
24
23
25
## Key Takeaways
24
26
25
27
To understand file and folder permission, there are three different types of owners:
26
28
27
-
-User - the user who is the primary owner of a file or folder.
28
-
-Group - any user who's part of a group with access to a file or folder.
29
-
-Other - anyone with access to the system.
29
+
- User - the user who is the primary owner of a file or folder.
30
+
- Group - any user who's part of a group with access to a file or folder.
31
+
- Other - anyone with access to the system.
30
32
31
33
There are also three different types of permissions:
32
34
33
-
-Read - a user can view and/or copy the contents of a file.
34
-
-Write - a user can modify the contents of a file.
35
-
-Execute - a user can run the file (if it's an executable app or script).
35
+
- Read - a user can view and/or copy the contents of a file.
36
+
- Write - a user can modify the contents of a file.
37
+
- Execute - a user can run the file (if it's an executable app or script).
36
38
37
39
The above permissions hold true for both files and folders.
38
40
@@ -42,20 +44,20 @@ If you issue the command ls -l within a directory, you'll see all of your files/
42
44
43
45
Here's the breakdown of that listing:
44
46
45
-
*-- the file type
46
-
* rw-rw-r-- - the permissions
47
-
* 1 - number of hard links
48
-
* jack - owner
49
-
* jack - group
50
-
* 0 - file size
51
-
* July 16 13:04 - modification timestamp
52
-
* testfile - the filename
47
+
--- the file type
48
+
- rw-rw-r-- - the permissions
49
+
- 1 - number of hard links
50
+
- jack - owner
51
+
- jack - group
52
+
- 0 - file size
53
+
- July 16 13:04 - modification timestamp
54
+
- testfile - the filename
53
55
54
56
What we want to focus on is the permissions. In our example that's `rw-rw-r--`. How this breaks down is simple. The permissions section is broken into three sections: owner, group, and other, each of which can have read (r), write (w), and/or execute (x) permissions. So our example breaks down like this:
55
57
56
-
-owner has read and write permissions.
57
-
-group has read and write permissions.
58
-
-other has read permissions.
58
+
- owner has read and write permissions.
59
+
- group has read and write permissions.
60
+
- other has read permissions.
59
61
60
62
If you see a `-` character, it means there are no permissions set for that. If the file had full permissions for all users, it would look like this:
61
63
@@ -65,10 +67,10 @@ So, `rwx` for owner, `rwx` for group, and `rwx` for other.
65
67
66
68
The question now is, how do we change that? With the chmod command, which has two different modes: absolute and symbolic. The easiest method is symbolic. Why? With absolute mode, you have to remember the following:
67
69
68
-
-read permission = 4
69
-
-write permission = 2
70
-
-execute permission = 1
71
-
-no permission = 0
70
+
- read permission = 4
71
+
- write permission = 2
72
+
- execute permission = 1
73
+
- no permission = 0
72
74
73
75
To change the permission in absolute mode, you add the permissions you want for each group. For example, if you want owner to have `rwx` permission, the total is 7. If you wanted group to have read and write permission, the total is 6, if you wanted to give other only read permission, the total is 4. String them together and you get 764. To make that change, the command would be:
74
76
@@ -124,4 +126,4 @@ The above command would change the user ownership to olivia. If you want to chan
124
126
125
127
`chown olivia:dev1 testfile`
126
128
127
-
And that is the basics of file and folder permissions in AlmaLinux. This skill will come in very handy throughout your career as a Linux user or admin.
129
+
And that is the basics of file and folder permissions in AlmaLinux. This skill will come in very handy throughout your career as a Linux user or admin.
0 commit comments