chmod 755 - Change Access Permissions

chmod 755 linux command is used for changing permissions for the files and directories. Only the file's owner or superuser can change the file access permissions.

chmod 755 command does following work:

  1. It gives read, write and execute (RWX) file permissions to file owner,
  2. It gives read and execute (R_X) file permissions to file's group owner and other system users.
  3. It removes write permissions from both file's group owner and other users.

Number after the chmod 755, is actually an octal number. First number 7 (4+2+1) represents 4-read, 2-write, and 1-execute permissions. Second and third number 5 (4+1) represents 4-read and 1-execute permissions

Octal Number

Octal number is a number system and It only has 8 digits starting from 0 to 7. That's mean we can only use numbers from 0 to 7 to make any number.

Octal numbers: 0,1,2,3,4,5,6,7

chmod 755 verify

To verify chmod 755 is executed successfully or not. You can use the below command.

ls -l

Let's take an example. We first create a sample file using touch linux command named chmod_verify.txt and check it's permissions.

chmod 755 before verify

In the above screenshot, first 1 character in "-rw-rw-r--" represents file type and rest nine characters represent file permissions for the file's owner, file's group owner and everybody.

File/Directory Owner Group Everybody
- rw- rw- r--

Now, run the chmod 755 command and executel ls -l command again.

chmod 755 verify

File/Directory Owner Group Everybody
- rwx r-x r-x

In the above screenshot, below work has happened.

  1. 4 character is changed to x, means file's owner got the execute permissions.
  2. 6 character w is removed now, means file's group owner write permission is removed and,
  3. 7 character x is changed from -, that means file's group owner got the execute permissions.
  4. 10 character is also changed from - to x, means everybody got the execute permision. 
File Types
Attribute File Type
- regular file
l symbolic link
d directory
c character special file
b block special file
Permission Attribute for Files
Attribute File Permissions
r Allow user to open file and read
w Allow user to write in file
x Treat file as executable and allow user to run it

Access permission work differently for directories.

Permission Attribute for directories
Attribute Directory Permissions
r User can check the directory contents if execute permission is also set.
w User can create, delete and renamed files if the execute permission is also set.
x User can enter into this directory for example, cd directoryname