
Now that you are aware of the basic terminology of file permissions and ownership, it’s time to see it in action. Understanding file permissions and ownership in Linux Write – Can add or delete files into directory (needs execute permission as well).Read – Can list all files and copy the files from directory.Execute – Can run the file (if its executable).

File permissions in LinuxĮvery file and directory in Linux has the following three permissions for all the three kinds of owners: In other words, ‘User’ is a single user, Group is a collection of users and Other consists of all the users on the system. Basically, anyone with access to the system belongs to this group. ‘Other’ can be considered as a super group with all the users on the system. Tip: Run the command groups to see what user-groups you belong to. Distributions like Ubuntu also create a group with name same as the user’s name.
#U he diva file permissions how to
You’ll see how to do it later in this article.Įven if you are the only user of the system, you’ll still be part of many groups. It saves time because instead of manually adding permission for each user, you can simply add them to a group and change the permission for the group. This way, you can manage files and security of the system effectively. A group consists of several users and this is one way to manage users in a multi-user environment.įor example, if you have dev team, QA team and sysadmin team accessing the same system, you should create separate groups for them. GroupĮvery user is part of a certain group(s). The ownership can be changed as well, but we’ll see that later. When you create a file, you become the owner of the file. I guess you know that directories are files anyway.Įvery file and directory in Linux has three kinds of owners: User Note: I might use the term file here but it is applicable to directories as well. Understanding file ownership and permission is crucial for a Linux user. Which file would be accessed by which user is decided by two factors in Linux:

This ensures that a file or directory can be accessed, modified or executed by only desired users. This is why UNIX and thus Linux (Linux is a Unix-like system) has built-in security measure in place. But if any user could access and modify all files belonging to other users or system files, this would certainly be a security risk. In an enterprise system, there would be multiple users accessing the same system. By design, Linux is a multi-user operating system.
