Permission-some special permissions

Source: Internet
Author: User
Tags superuser permission
However, if this permission is set for a directory, the user is prevented from deleting or renaming the file, unless the user is the owner, file owner, or super user of the Directory. It is often used

Introduction

Although the octal mask is usually represented by three digits. But technically, it is represented by four digits.

Why? In addition to the read, write, and execute permissions, there are some other less-used permissions.

========================================================== =

Setuid bits (octal representation: 4000)

When it is applied to an executable file, the valid user ID is set from the actual user ID (the user who actually runs the program) to the ID of the owner of the program.

In most cases, this permission setting is usually used in programs owned by super users.

When a common user runs a program with the "setuid root" permission, the program is executed with the superuser permission.

This allows the program to access files and directories that are generally prohibited by common users. So be careful.

========================================================== =

Setgid bit (octal representation: 2000)

It is similar to the setuid bit. It will change the valid group ID from the user's actual group to the group ID of the file owner.

========================================================== =

Sticky bit (1000 in octal format)

This permission can mark an executable file as "unchangeable ".

In linux, the sticky bit of the file is ignored.

However, if this permission is set for a directory, the user is prevented from deleting or renaming the file, unless the user is the owner, file owner, or super user of the Directory.

It is often used to access shared directories.

========================================================== =

Example

[Root @ allyes ~] # Chmod 2777 1.txt

You have new mail in/var/spool/mail/root

[Root @ allyes ~] #

========================================================== =

Related Article

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.