File Permissions Intro

File Permissions Intro


If you are just getting into linux and upto now have only been using MS Windows operating systems you might find file permissions a bit of a nightmare. Hopefully this page will explain them for you.
Permissions apply to all users on a system apart from the "root" user (the superuser), this is one of the main reasons why you should not log in as "root" apart from when doing system maintenance.

UNIX file permissions are split into the three main following sections:

  • User (owner of the file).
  • Group (everyone with the same group name as the owner).
  • Others (anyone else on the system).
When a new user is created they are given a user name (what they log in with) and a group name to belong to. These groups are usually self-explantatory and aids system administration among other things.

Within these three sections you can specify the following options shown in the table below
(in "ls -l" display order).

For the owner of the file:
CharValuePermission
r400Read
w200Write
x100Execute

For the owners group:
CharValuePermission
r40Read
w20Write
x10Execute

For all others not in the owners group:
CharValuePermission
r4Read
w2Write
x1Execute


Here is a typical directory listing using the "ls -l" command, with a files permissions indicated on the left.

ls -al output showing permissions

If we take one of the files permissions and split it up into its different sections as shown in the diagram below:

the different permission sections

As you can see, each section has the space for the three options show in the table above. Where there are "-" characters show that the specific permission is not set.
So, the above set of permissions read:

  • Read and write permissions for the user who owns the file ("mark" in this case).
  • Read permissions for other users in the same group as the owner ("users" in this case).
  • Read permissions for everyone else on the system.

File permissions also apply to directories in the same way, but the options have a slightly different meaning.

  • Read access allows users to view a directorys contents.
  • Write access allows users to create files in the directory.
  • Execute allows users to change into the directory.

download file now

Unknown

About Unknown

Author Description here.. Nulla sagittis convallis. Curabitur consequat. Quisque metus enim, venenatis fermentum, mollis in, porta et, nibh. Duis vulputate elit in elit. Mauris dictum libero id justo.

Subscribe to this Blog via Email :