Page 41 - RHEL8 BOOK
P. 41

Default Permissions
                                  File                                 Directory

           Created by root       rw_r_ _ r _ _        644      rwxr_ x r _ x      755
           Created by user       rw_rw _ r _ _        664      rwxrwx r _ x       775

          When a file created with the help of cat, touch, vi will get the permissions as 644.

          - rw- r-- r—
          i.e.
          - read-write for the owner.
          - read-only for the owners group and
          - read-only for the others

           Actually in the basic UNIX system when a file is created it gets the permission as 666. But this lapses in
          security, so whenever a file is created in UNIX System it masks some bits, with a mask value of 022.

           After masking we get the default value of a file as
          644. [666 - 022 = 644]

           022 is as the UMASK value.lt File Permission

          To view the Umask value
          [root@comp1 ~]#umask

          To view Umask value from file
          [root@comp1 ~]#vi /etc/bashrc

          When a directory is created with the help of mkdir will get the permissions as 755.
          d rwx r-x r-xfault Directory Permission
          Actually in the basic UNIX system when a directory is created it gets the permission as 777. But this
          lapses in security, so when ever a directory is created in UNIX system it masks some bits, with a mask
          value of 022.
           After masking we get the default value of a file as 777. [777 - 022 = 755]
          022 is as the UMASK value.

          fault Directry Permission
           Chmod: - command is used to change the permissions of a file/directory.
           chmod can be used by the owner of the file or by root. With chmod command we can assign permissions
          or remove permissions as required.







                                                       S. Pradhan
                             (MCA, MBA-IT, BCA, CCNA, MCSA 2012, RHCE, ETHICAL HACKING)
                                             Email Id:-spradhan.iiht@gmail.com
                                                           41
   36   37   38   39   40   41   42   43   44   45   46