File Permissions and Umask

 permissions:-

************

-> the set of rules set according to users & groups & others are called as permissions

-> we 3 basic permissions

-> in the permission "." after the permissions is represents that mo ACL permission is applied.



1) read --> r --> 4

2) write -> w --> 2

3) execute -> x -> 1


#ls -l  --> to list the perm of all normal files & dir


user owner group owner others

- rw- r-- r-- <user owner> <group owner> ----- ---- <filename>

d rwx r-x r-x <user owner> <group owner> ----- ----- <dir name>


- rw-rw-rw-

d rwxrwxrwx 


umask [user mask]

*****************

-> umask value determines default permissions on file & dir

-> max perm for file is 666

-> max perm for dir is 777

-> by default umask vaule of root user  "022"

-> by default umask vaule of normal user "002"

-> umask is nothing but changing the perm of file or dir before creation

-> to know the umask value of perticular user is

#umask  

022


$umask 

002


file:

*****

max perm for normal file 666 (rw-rw-rw-)

default umask vaule of root user 022 (    w  w )

  (-)

************************************************************

default perm for  file is 644     (rw-r--r--)

************************************************************


dir:-

****

max perm for normal dir 777 (rwxrwxrwx)

default umask value of normal user 002 (       w )

   (-)

**************************************************************

default perm for dir is 775 (rwxrwxr-x)

***************************************************************


changing the umask value:-

**************************

1) temperary 

2) permanent


temperary:-

**********


#umask   --> to know the present umask value


#umask <umask vaule>   --> to change the umask value temp


ex: #umask 000       --> it will not remove any perm


#umask


#touch g1 


# ls -l g1


-rw-rw-rw-  --- ----- ------ g1



permanent:-

***********

-> edit config file /etc/bashrc


#vim /etc/bashrc


-> fot changing root user umask value go to line  77 line

-> for chnaging normal user umask value go to line 75 line


:wq!



#umask  --> the changes will not be done until u exec the shell


#exec bash  --> to update the shell with default settings


#umask















Comments

Popular posts from this blog

AIX migration using alt_disk method

HMC - List the Port VLAN IDs and Additional VLAN IDs ( tagged ) associated with the NICs of a LPAR.