Linux Notes 2--permissions

Source: Internet
Author: User

Observing file types

Stat
file: ASCII data binary or is there a dynamic function library
Type

-T Show him the meaning of file. Alias. Builtin built-in
-A Lists the path
-P Displays the full file name of the external directive


File Special permissions: ID (list your own information)

Add another 1 digits before you change the permission 3 digits chmod nxxx FILE

4 SUID S Owner
2 SGID S Group
1 Sbit T Other
These 3 permissions need x permission to support, if a file does not have X permission, then directly to give
Special permissions will be overhead, is virtual, the system will prompt these permissions are capitalized SST


Suid:set UID
The S flag, which allows the executable to be owned by the host when it is run.
As long as you have X and suid, you can become USER at run time.


Pstree-u | grep root   |                        |      | -PASSWD (Root)


When a normal user runs passwd, it switches to the root identity.


SUID can only be used in binary files and cannot be used in shell script files



Sgid:set GID
When s this flag appears in group X, it is called set GID
The file is executed with the same rights as the user group.


After the directory has set the SGID permissions
Users can enter this directory if they have r and X permissions for this directory;
The user's active group (effective group) in this directory will become a group of that directory;
Use: If the user has the permission of W in this directory (can create a new file), users are established
New file, the group of the new file is the same as the group in this directory.



Sticky Bit
Sbit is currently only valid for the directory, when the user has W, x permission for this directory, but also has write permission;
When a user creates a file or directory under that directory, only himself and Root have the right to delete the file.

Linux Notes 2--permissions

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.