In Linux, the file permissions are the owner’s rights. The owner can share the rights of its file with different users by defining some conditions. The permissions are represented in specific alphabets and octal values.
This post will briefly describe the “755” permission in Linux. Alongside that, we will also explain the basics of permissions in Linux. The content of this post is as follows:
Let’s start with the basic understanding.
Understanding of the File Permissions in Linux
Before proceeding to the meaning of “File Permission 755”, it is compulsory for the readers to be well known for file permission in Linux.
In Linux, there are always three types of users for using the files. These users are:
Permissions w.r.t Users
Owner | This is the owner of the file who created it |
Group | This is a group of users which can access the file on some granted permissions |
Other users | Other than these, users should be considered in this category of the users. These users also include guest users. |
Various types of permissions can be granted to the users; these permissions are described in the following table.
Permission | Description | Representation | |
---|---|---|---|
Alphabetical | Octal | ||
Read | Read Permissions | r | 4 |
Write | Write Permissions | w | 2 |
Execute | Execute Permissions | x | 1 |
Let’s understand it more clearly through an example.
$ ls -l
In the above figure, the permissions of different users are as follows:
- User and the group has the read (r) and write (w) permissions.
- Other users are allowed only to read the file.
If we talk about the same permissions in octal representation, it becomes “664”, which can be understood from the following table.
Permissions | Owner | Group | Other Users |
---|---|---|---|
Read | 4 | 4 | 4 |
Write | 2 | 2 | 0 |
Execute | 0 | 0 | 0 |
Total | 6 | 6 | 4 |
The first digit of the 664 explains the permissions of the owner, the second digit explains the permissions of the group, and the last digit, explains the permissions of the other users.
What Does the File Permission 755 Mean?
Following the example stated in the previous section, we can demonstrate the “755” permission in the following manner:
Permissions | Owner | Group | Other Users |
---|---|---|---|
Read | 4 | 4 | 4 |
Write | 2 | 0 | 0 |
Execute | 1 | 1 | 1 |
Total | 7 | 5 | 5 |
Let’s understand it more clearly:
- “7” shows that the “Owner” has the read(r), write(w), and execute(x) permissions.
- “5” represents that the “Group” has read(r) and execute(x) permissions only.
- The last “5” means that the “Other Users” have read(r) and execute(x) rights.
Example: Grant 755 Permissions to a File
To understand the 755 file permissions, we will create a file with the name “MyFile” using the command:
$ touch MyFile
Now, we will set the permissions of the file to “755” using the “chmod” command utility as follows:
$ chmod 755 MyFile
To display the permissions of the file, MyFile, we will list down the contents:
$ ls -l
In the above figure, we can see that the owner of the file has full access( read, write, and execute), the group and other users have only read and execute permissions.
This is all about the 755 permissions in Linux.
Conclusion
In Linux, the file permissions 755 means that the owner has full access (read, write, and execute permissions), and the remaining users have only read and execute rights. The “7”, “5”, and “5” are the octal representations of “r, w, x”, “r,x”, and “r, x”, respectively. This post has briefly explained the file permission “755” in Linux.