Get the App
SLTechnology News&Howtos  ›  Servers  › 

V. traditional IDC deployment website

Shulou Source: shulou.com Published: 2022-06-02 19:07:20 10月03日 Update

Traditional IDC deployment website

1. Hide permissions lasttr_chattr

2. Special permission set_uid

3. Special permission set_gid

4. Special permission stick_bit

5. Soft link file

VI. Hard-linked files

1. Hide permissions lasttr_chattr

Chattr + I cannot modify the contents of the file

Chattr+a cannot change, delete, rename, and the contents of the file can only be appended to touch

Directory plus I permission is the same as file plus I permission.

Chattr + I + a-I-a

Lsattr-R-a-d

2. Special permission set_uid

Set_uid can temporarily have the permissions of the root user owner. The prerequisite for setting set_uid permissions for a file is that it is a binary file and an executable file, such as ls passwd.

3. Special permission set_gid

Set_gid can temporarily have the permissions of the group to which it belongs, not only on the file, but also on the directory, similar to set_uid on the file, it allows the ordinary user who executes the file to have the permission of the group temporarily. When acting on a directory, when creating subdirectories and subfiles, the subdirectories and subfiles created are consistent with the groups to which the directory belongs

4. Special permission stick_bit

Also known as anti-deletion bit, to prevent others from deleting their own files except root users

5. Soft link file

A shortcut similar to Windows

Ln-s source file target file

Soft links can be linked not only to files but also to directories, and soft links can be made across partition relative paths only in the current directory.

Try to use absolute paths to make soft links.

For example, I have a service running under / boot, but / boot has run out of memory space, but if you move this file, the service will have a problem, because the service runs according to the path. We can first copy that log file to a partition with a large disk space, such as /, then delete the log file in / boot, and then make a soft link file. The service comes according to the path. After making the soft connection file, although the log file is still written in / boot.log, the storage location has actually been changed to / this partition.

VI. Hard-linked files

Do not support hard links to directories only support files to do hard links will not take up extra space

Files can be hard linked, but one premise is that hard links cannot be deleted across partitions, and multiple files point to the same inode number.

Delete one and have another, relatively safe, but it is not appropriate to back up files by hard link.

Hard link is essentially a file, the establishment of multiple hard link files, space occupation or a copy, can save space

Hard links to use ln directly do not need to add s options like soft links

Tags: File link permission directory special space function path service ownership log user or binary content premise multiple subdirectory time Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Redmi macOS Shulou Tech Info Linux