LinuxOperating Systems

Linux: chmod cheat sheet

Quick brief:

Using chmod is simple, the numbers appended refer to the Owner/Group/Everyone (in that order). Remember you can always use chmod -R {PERMISSION} /path/to/dir for it to recursively set permissions on all files and sub directories. 

The numbers explained:

For example if we wanted full access to a file we own and no group or person to have access to it we would use:

~#chmod 700 file

0Nothing

1Execute the file

2 Write the file

3 Write and Execute the file

4 – Read the file

5 Read and Execute

6 Read and Write

7 – Read and Write and Execute

Common permissions:

chmod 644Owner of the file is able to Read / Write, group and others can read

chmod 664Owner and group are able to Read / Writegroup and others can read

chmod 666 – ALL users can Read / Write 

 chmod 700 Owner is able to Read / Write / Execute, group and others have no permissions

chmod 755 Owner is able to Read / Write / Execute, group and others are able to Read / Execute

 chmod 775 Owner and group can Read / Write / Execute, others are able to Read / Execute

chmod 777 – ALL users can Read / Write / Execute