Linu basis of management authority

XXII, rights management

22.1) What are permissions

For some files or processes, user restrictions, permissions can be understood as a constraint for the user to operate the system did.

22.2) and the relationship between the rights of users

    [centos7 the root @ ~] # LL 
  Total 1364
  drwxr-XR-X. 2 the root 18 is the root On Jun. 6 the conf 17:43
  D file type   rwx file owner (ordinary) privileges   rx file (genus group) is a group of users   rx other user   2 number of hard links   root file owner (user belongs)   root is a group (user group) files   6 size of the file (the number of bytes in the file)   On Jun 18 is 17:43 file modification time   conf file name









 

    - Common File l soft link file S Socket, socket c block device               


 

22.3) License

22.3.1) plus minus Authorization
    rw- r-x -wx
--x -w- r--
--x -w- r--
rwx ---> u(user)g(group)o(other)

[root@oldboy ~]# chmod u+w zls
u+x
g+w
o+r
22.3.2) digital rights
    r:4     w:2     x:1     -:0
chmod 755 test.txt
22.3.3) equal to the number of authorized
    [root@oldboy ~]# chmod u=rwx,g=rw,o=r zls

 

Role 22.4) permissions to the file, directory

Action 22.4.1) permissions to the file
    Only r file permissions: have read \ read the contents of the file permissions 1. class can use the View command CAT, head, tail, less, More 2. can not be copied, can not move, can not be edited, you can not delete write permission (w) if the file only w rights: a new, modified contents of the file permissions 1. use vim editor will be prompted to refuse permission, but can be forced to save, will cover all the contents of the file 2. using echo, cat, or append command redirection redirection techniques can go written in the file data 3. can not be copied, can not move, can not be deleted (delete permissions need to see the parent directory w) execute permissions (x) files only x permissions have permission to execute the file. // Note: The average user needs to have permission to r, administrators do not need 1 can not be executed, view, edit, copy, move, delete








 

    Rwx summary of the document affect the 
read permission (r) has read \ read the contents of the file permissions
1. Use only view the class command cat, head, tail, less, more write permission (w) have to add, modify files privileges of content 1. use vim editor will be prompted to refuse permission, but can be forced to save, will cover all the contents of the file 2. data can be written to a file using the echo command in the redirection of the way, can be added >> 3. You can not delete file, delete the file because the properties are not looking documents, it is necessary to see if the parent directory has permission w execute permissions (x) has permission to execute a file 1. Do what permissions are not 2. If the average user needs to perform a file, you need to r with permission








 

Action 22.4.2) access to a directory
    Only r directory permissions: browse the directory and subdirectories have permission 1. Use the ls command can browse the directory and subdirectories, and you will be prompted to refuse permission 2. ls -l command can be used to browse the directory and subdirectories, with a question mark will, at the same time only see the file name summary: only r directory permissions can only file name in the browser, no write permission (w) other operating authority if the directory permissions only w: have to add, delete or modify the file permissions in the directory name (required x with) // Note: If the directory has w permission, you can create files in the directory, delete the file (the file itself has nothing to do with permissions) can not enter the directory, you can not copy the directory, you can not delete a directory, the directory can not be moved execute permissions (x) directory only x permission 1. only enter the directory 2. can not browse, copy, move, delete,








    rwx For a directory:  r: can not enter the directory, you can see the file or folder name by ls, ls -l only see if a file or folder attributes are all ??? w: w no simple the significance of x: enter the catalog, what can be done


    A combination of directory permissions rx: to enter a directory and you can view the files inside, but you can not delete a file, if you want to modify files need to look at the file permissions 
Rwx summary of the impact on the directory  read permission (r), r only if the directory permissions: browse the directory and subdirectories have permission to 1. You can use the ls command to browse the directory and subdirectories, but it will also prompt permission denied 2. Use ls - l command to browse the directory and subdirectories, file attributes with a question mark, and can only see the file name summary: only r directory permissions can only file name in the browser, no other operating authority write permission (w), if directory only w permissions: has added, deleted or modified within the directory file name permissions (need x permission with) PS: If the directory has w permission, you can create files in the directory, delete files (nothing to do with the file itself permissions) can not enter the directory, can not copy the directory, you can not delete a directory, the directory can not be moved execute permissions (x), x only if the directory permissions 1. only enter the directory 2. can not browse, copy, move, delete,











 

Guess you like

Origin www.cnblogs.com/dabai-wang09/p/11116848.html