Rights Management (chown, chgrp, umask)

For permission to modify a file or directory, only the owner and administrator files have this permission, but to change the owner of a file or directory, only administrators have this permission (although the average user to create a file or directory, users can not modify the owner of a file or directory).

1, chown (change owner of a file or directory):

Create a regular user, the owner of the file created by an administrator changed the administrator failed:

 

 

 Myfile1 create a file in your home directory by the average user:

 

 

 Queries ordinary users Owner:

 

 

 Administrator owner of the file changes:

 

 

 The owner of the query file:

 

 

 2, chgrp (change group belongs to a file or directory)

Create a group:

 

 

 Add members to the group:

 

 

 As can be seen, add files to the group after the group has changed file.

3, umask command (the default permissions to view the file or directory):

Execution umask -S view the default permissions on the file or directory: 

 

 

 Create a directory and view permissions:

Create the file and view file permissions:

 

 

 The default directory permissions consistent with the default permissions for the query, but do not write because the default permissions newly created files, so files are missing write permission.

 It can change the value of umask.

 

Guess you like

Origin www.cnblogs.com/zhai1997/p/11809681.html