CHMOD Permissions

CHMOD is a Unix command created from the words ‘change mode’. CHMOD permissions is used to change permissions or user privilege of a file.

Kinds of Users :

There are 3 different kinds of users who will access your files.

1. Owner – Users who has the server administrator rights.
2. Group – Specific group of people that the server administrator has identified.
3. Public – World.

Types of Permission :

1. Read – Access to view the file.
2. Write – Access to write and delete the file.
3. Execute – Access to run a file or program.

The index used for alphabets used are as follows:

U = User
G = Group
W = World
r = Readable
w = writable
x = executable

– = no permission

chmod-infographic-001

As you can see, each row-coloumn intersection has a value. Typically,

1. The ‘Read’ access level has a value of 4,
2. The ‘Write’ access level has a value of 2, and
3. The ‘Execute’ access level has a value of 1.

The CHMOD values from each row are added up into one of the columns of the final value.

PERMISSION COMMAND

U G W

rwx rwx rwx                          chmod 777 filename
rwx rwx r-x                           chmod 775 filename
rwx r-x r-x                            chmod 755 filename
rw- rw- r–                            chmod 664 filename
rw- r– r–                              chmod 644 filename

Here is another way of looking at it:

Permissions:

400 read by owner
040 read by group
004 read by anybody (other)
200 write by owner
020 write by group
002 write by anybody
100 execute by owner
010 execute by group
001 execute by anybody

To get a combination, just add them up. For example, to get read, write, execute by owner, read, execute, by group, and execute by anybody, you would add 400+200+100+040+010+001 to give 751.

2 responses on “CHMOD Permissions

  1. The same permission, are set by chmod while they act on the files or folder or group of files and folder which is owned by the root : group : and world.

    The chown act as owning the file to set permission later with chmod. Is it ? if i am wrong let me know.

  2. Yes, Chown is a abbreviated for “change owner”. It is used to change the ownership for the file while the Chmod is used to assign what privilege to provide to the users to access the file.

Leave a Reply