Linux chattr permissions explained in detail

>>> Linux tutorial directory <<<

Permission management-3.1 file system attributes chattr permissions

Write in the front: If you finish the inspection by yourself, there may be some mistakes. If you find something wrong, you can leave a message or private message me below.

1. Chattr command format

  • chattr [+-=] [options] [file or directory name]
    • +: Increase permissions
    • -: Delete permission
    • =: Equal to a certain authority
  • Option i
    • For files: It is not allowed to delete or rename files, nor add or modify data
    • For directories: only the data of the files in the directory can be modified, but it is not allowed to create and delete files
    • The i attribute is equivalent to being locked and can only be seen, and is also restricted to root
  • Option a
    • For files: data can only be added to the file, but the data cannot be deleted or modified
    • For directories: only files created and modified in the directory are allowed, but deletion is not allowed

2. View file system properties

  • lsattr [options] [file name]
    • -a: display all files and directories
    • -d: If the target is a directory, only the attributes of the directory itself are listed instead of the sub-files

Write in the back: I hope these explanations will be helpful to you, I hope everyone will like and pay attention to it. Your support is my biggest motivation (๑> ؂ <๑)

Published 366 original articles · praised 68 · 50,000+ views

Guess you like

Origin blog.csdn.net/qq_43479432/article/details/105635810