Linux Learning Notes (ix) Set_uid, Set_gid, stick_bit, soft link files, hard connect files

Source: Internet
Author: User

First, special authority Set_uid

Can only be used for binary executables, which allows the user to temporarily have the permissions of the file owner
For example: Normal does not have root permission, but the command to change password passwd and need root permission, so, passwd command is given Set_uid permissions, so that ordinary users can temporarily get root permission to change the password;

Usage is

chmod u+s  
Second, special authority Set_gid

Similar to SET_UID usage
When acting on a file, you can allow the user to temporarily own the permissions of the group to which the file belongs.
When you create a new file or folder in a folder when you are acting on a folder, the owning group for the new file or folder is the same as the group that owns the parent folder


Usage is

chmod g+s  /tmp/123/
Third, special permission Stick_bit

Anti-Delete, after adding this permission to the folder, no user can delete the files created by other users in the directory, but if there are subfolders and subfolders without the permissions of the subfolder, then the user within the subfolder may delete other user-created files, that is, there is no anti-deletion, only see the file's parent folder has T permissions

Usage

chmod o+t /tmp/123/
Four, soft link file

Similar to the shortcuts in Windows, taking up a small amount of memory space, deleting the source files will invalidate the soft connection, the soft connection can be used for files and folders, can be established across partitions, soft connections preferably use absolute path;

用法 ln   -s     [来源文件]     [目的文件]
Five, hard connection file

I personally understand that as a hard link can be a person's other name, a person can have multiple names, but this person's entity only one, a name does not affect the use of other names,
Similarly, hard links do not occupy double space, the target and source of hard links to delete one, does not affect the use of another, hard-linked files have the same inode number, hard links can not be established across partitions, because different partitions will have the same inode number, hard links can only be used for files, can not be used for folders
Usage
ln [source file] [destination file]

Linux Learning Notes (ix) Set_uid, Set_gid, stick_bit, soft link files, hard connect files

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.