day6-Linux file and directory attributes and permissions (ob-03)-2

Attributes and permissions of Linux files and directories -004

Insert picture description here
w and x work together to take effect
Insert picture description here
Insert picture description here
Insert picture description here

Attributes and permissions of Linux files and directories -005

setuid和setgid

The setuid and setgid bits allow ordinary users to run programs or commands that only the root account can run as the root user. (Note the difference with su and sudo) For
example, the passwd command, the final modification is /etc/passwd, and the owner and group of the file are both root.
Insert picture description here
Insert picture description here
Insert picture description here

Paste bit (understand)

Insert picture description here

Insert picture description here

Attributes and permissions of Linux files and directories -006

Ownership of files or directories

Change file ownership command chown

chown [选项]... [所有组][:组] 文件
chown oldboy:root test.txt
chown root.root test.txt
说明:chown所接的新的属生和新的属组之间应该以.或:连接,
属主和属组任意之一可以为空。如果属主为空,应该是:属组﹔如果属组为空就就不必需要.或:了。

chown也提供了参数,这个参数对目录改变属主和属组极为有用,我们可以通过加-R参数来改变某个目录下的所有文件到新的属主或属组;

Change the file's belonging group command chgrp

chgrp oldboy oldboy.txt

Insert picture description here

Detailed introduction and practice of Linux system hard link and soft link

Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here

Production use cases of soft links

Insert picture description here
Insert picture description here

END

Guess you like

Origin blog.csdn.net/Nightwish5/article/details/113730463