7. Permission - Agnivo102/Database_Architect GitHub Wiki
Permission in Linux:-
rwx rwx rwx :-
First set of tex represent the permission of owner.
Second set of permission is for group users.
Third set of permission is for public user.
Example :- I am on group X. I have created a file. I am the owner of the file. My permission is on the 1st set of permission. User Y works with me in group X. Y's permission will be on the second set of permission. Similarly my boss is on Admin department. My boss's permission will be on the 3rd set of permissions.
Values of each permission. They are same across every OS.
Read :- 4
Write:- 2
Execute :- 1
Owner can change the permission for every set of users.
chmod 755 file name:- Change the permission. 7 (Came from adding the values of Read, Write and Execute. First number is for the first set(owner))5(Came from adding the values of Read and Execute. Second number will be for 2nd set (group))5(Came from adding the values of Read and Execute. Third number will be for 3rd set (public)).
chmod 755 directory name:- Change the permission. 7 (Came from adding the values of Read, Write and Execute. First number is for the first set(owner))5(Came from adding the values of Read and Execute. Second number will be for 2nd set (group))5(Came from adding the values of Read and Execute. Third number will be for 3rd set (public)).
Note:- This comamnd will change the permission to the parent directory and will nor change the permission of sub directories.
chmod -R 755 directory name :- This will change the permission of the entire Directory including the files and sub directories.