Man­ag­ing owner user, group owner and other user per­mis­sions

OpenSource For You - - LET'S TRY -

Now, the ques­tion is how do we change the per­mis­sions for im­ple­ment­ing se­cu­rity? The an­swer is the chmod com­mand.

Let’s sup­pose we cre­ate a file named f_shob­hit us­ing the com­mand touch f_shob­hit. The de­fault per­mis­sions at­tained by this file will be r w – r w – r - -. To change the per­mis­sions of the file f_shob­hit us­ing the nu­meric mode, ex­e­cute the fol­low­ing com­mand:

1. Now, ex­e­cute the fol­low­ing com­mand:

The user owner will not be able to use cat, vim and other com­mands on a file. In­stead, the user will get a ‘Per­mis­sion De­nied’ er­ror (see Fig­ure 2). Although vim is meant for edit­ing a file, due to no-read per­mis­sions, the con­tents will not be read by vim and so can’t be mod­i­fied. Sim­i­larly, nei­ther mem­bers of group shob­hit nor other users will be able to read the file. 2. Now, add read per­mis­sion to user owner:

Newspapers in English

Newspapers from India

© PressReader. All rights reserved.