KNOW ABOUT USER PRIVILEGES IN UNIX



Can we create file in another directory in UNIX ?

Let we understand by the help of example. 
Suppose we have two user Raj and Anil. Privilege of Raj is 700 and Privilege of Anil is 777.

here , 700 means  ( _ r w_ _ _ _ _ _ _  ) only read write permission. and
        777 means ( _ r w x r w x r w x ) all permission.

As we know that :
_        : No permission
r        : Only read permission
w       : Only write permission
x        : Only execution is permitted.

So Raj have only read/write for owner and no other permission for group member and others. Anil have all permission for  owner,group and others.

Now we understand by:


Now from the above diagram it is clear that Raj user can create any new file in Anil directory by copy command but Anil user can not create any new file in Raj directory because Raj privilege is 700 and Anil privilege is 777. I already describe above about meaning of 700 and 777.

When Anil want to create any new file in Raj directory the output is permission denied because Raj have only privilege 700 means ( _ r w_ _ _ _ _ _ _ ) only r/w for owner , group for 0 and other for 0 , Anil is neither owner nor group member for Raj he is other and other have no privilege to Raj. So he can not create new file.

Note : If any person is a member of more than one group than one group is primary and other is secondary.

UNMASK VALUE :-

This is a system default / define value. This process is done when only any new file is created.

Suppose:

    777      ( maximum permission granted )
  - 133      ( unmask value / system default value )
----------
    644       ( Default value )
----------
Now the default permission granted value is 644.
here 644 means ( _ r w _ r _ _ r _ _ )

If we want to define Unmask value from own side than run following command.
$ unmask = 177
where 177 is user define value (own choice)
For Understand Permissions see following 👇

Above diagram show every thing about User Permissions.

No comments:

Post a Comment