Permissions analysis for Linux files and directories

Source: Internet
Author: User

Linux permissions: As the name implies is the ability to give users the right to access the specified files and directories and no right to access the specified files and directories

Here's a look at what general permissions are under Linux

650) this.width=650; "Width=" "height=" 398 "title=" 1.png "style=" width:700px;height:398px; "alt=" Wkiom1uvgakjh86oaai4qn18zee502.jpg "src=" http://s3.51cto.com/wyfs02/M02/6B/87/ Wkiom1uvgakjh86oaai4qn18zee502.jpg "border=" 0 "vspace=" 0 "hspace=" 0 "/>

650) this.width=650; "title=" 2.png "alt=" wkiom1uvgjvquncvaacwo3-oto8976.jpg "src=" http://s3.51cto.com/wyfs02/M02/ 6b/87/wkiom1uvgjvquncvaacwo3-oto8976.jpg "/>

Let's take a look at the special permissions for files in Linux:

SUID: Temporarily allow certain users to execute files as Administrator with the permission of the owner of the file, but cannot add parameters to determine the identity of the initiator

Example:-rwsr-xr-x. 1 root root 30768 Feb 2012/usr/bin/passwd
Give SUID permission
chmod u+s FILE ...

Sgid: Common: Directory settings Sgid All users in this directory, the genus group that created the file is a group of directories
chmod g+s FILE ...

Sticky: Sticky bit

chmod o+t FILE ...

suid | Sgid | Sticky
4 2 1

You can use numbers to change

Example: chmod 7777 a.txt

-rwsrwsrwt.1 root root 5 Apr 09:52 a.txt

This file represents the permission to have suid sgid and sticky bits

Permissions match:

Check the owner-"Check access list of the owner-" inspection group-"Check access list of the genus group-" Check other users-"Check access list other users

Additionally, the file has extended properties that can be lsattr to display chattr to change

A: File content is not allowed to be added only
C: Compression format
D: No Backup
E: Extended Format
I: Prevent administrators from forcibly writing
J: Data Log
S: Safe removal
T: Merge is not performed at the tail
A: Do not update the access timestamp
u: Prevent administrators from deleting
D: Directory synchronization update
S: File Sync update
T: Directory set to top-level directory

In addition, FACL allows users to have additional access mechanisms

Getfacl Show Access list

Setfacl Setting Access lists
Format:

SETFACL-Option U or g: User name or group name: Permissions FILE ...

Options:

-M add additional access authorizations

-X Cancel Authorization

-R recursive settings (for directory settings)

Summarize:

Linux has more and more privileges. These are just superficial permission settings, specifically the reader's own man for each set of commands and usage.

This article is from the "Linux_mayi" blog, make sure to keep this source http://jlxmy.blog.51cto.com/8497132/1634872

Permissions analysis for Linux files and directories

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.