Understanding Linux File Permissions

If you are a Linux user, you probably already know about the different Linux file permissions. This is not going to be a comprehensive blog post, but it should still help you understand Linux file permissions if you do not already understand them.

There are three different main groups for Linux permissions (user, group, and world).

——————-

User:  This stands for the user account that owns the file / folder that it is assigned to.

Group:  This stands for the group(s) that are assigned to the file / folder. Groups can be your own private group that you get when your Linux user account is created, and / or can be other people’s and services’ groups as well. Any permissions set here affect **all** groups that are assigned to the file / folder.

World (all users):  This stands for the permissions that *everyone* that has access to the server and *all* services on your server have. Be very careful with this permissions “group”. Setting the “world” permissions to allow writing would mean that *anyone* or *anything* that has access to your server (hacker or no hacker) can now potentially write to your file / folder! Not good!

——————-

When using a terminal (usually via SSH) in Linux, you would have seen file / folder permissions that look something like this:  myfile.txt  rw-rw—  John [owner]   John [group]

rwx——

The “r” above, in the first three letters, tells you that owner of the file / folder has “read” permissions.

The “w” above, in the first three letters, tells you that owner of the file / folder has “write” permissions to the file / folder.

The “x” above, in the first three letters, tell you that that owner of the file / folder has “execute” permissions.

—rwx—

The “r” above, in the middle three letters, tells you that all of the groups assigned to the file / folder has “read” permissions.

The “w” above, in the middle three letters, tells you that all of the groups assigned to the file / folder has “write” permissions to the file.

The “x” above, in the middle three letters, tell you that that all of the groups assigned to the file / folder has “execute” permissions.

——rwx

The “r” above, in the last three letters, tell you that that *everyone* that has access to the computer, and *all* services on the computer, now have “read” permissions to the file / folder.

The “w” above, in the last three letters, tell you that that *everyone* that has access to the computer, and *all* services on the computer, now have “write” permissions to the file / folder.

The “x” above, in the last three letters, tell you that that *everyone* that has access to the computer, and *all* services on the computer, now have “execute” permissions to the file / folder.

——————-

You now should have a basic understanding of the different basic Linux permissions!


Posted in Operating Systems