Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the Linux Rights Management chmod 755 tutorial like?

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article shows you what the Linux rights management chmod 755 tutorial is like, the content is concise and easy to understand, it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

People who have not done much with Linux always wonder why I can manipulate this file after you execute chmod 755. What does chmod xxx mean? Let's listen to this article to explain to you one by one!

Before we begin, let's take a look at a picture:

We can see that after executing the ls-l command, each line is preceded by a "- rwxrwxr-x". What does this magic code mean? Why did this code change again after the implementation of chmod 755 xttblog.sh?

To illustrate these two issues, we must start with the permissions of Linux. "- rwxrwxr-x" these 10 characters, the first character represents the file type. Under Linux, file types are divided into the following types:

D: directory directory

L: symbolic link link

S: socket socket

C: character device char

P: named pipe pipe

Others do not belong to the above categories

The-here represents other types. The next nine characters of "rwxrwxr-x" are related to the access mode. In which three characters are combined into a group. Each group represents a different kind of permission.

The three characters rwx represent the access method of read-write execution:

Read (read): display content

Write (write): edit content, delete files

Execute (execute): execute fil

Don't take the initials of these three words to form an abbreviated form of rwx. Then why are there three groups, three groups, divided into three groups?

The answer is that there are three types of permissions for users to access Linux files:

Creator (user) permission: the person who created the file

Group (group) user rights: other people in the same user group as the owner

Other (other) user rights

The first 9 characters, each in groups of 3, represent: creator (user) rights, group (group) user rights, and other (other) user rights.

To sum up, these ten characters can be divided into four parts:

The first character indicates the type of file: [-] represents a normal file

Character 234 indicates the creator's permission: [rwx] indicates readable, writable, and executable.

Character 567 indicates group user permissions: [rwx] means readable, writable, and executable.

Character 890 indicates other user rights: [rmurx] indicates readable and executable

The chmod command is used to change the permissions of a file, and it can be used in two ways.

The first kind: chomod [who] [operator] [permission] filename

[who]

U: creator

G: group user

O: other users

A: all users (all)

[operator]

+: add permissions

-: revoke permissions

=: set permissions

[permission]

R: read

W: write

X: execute

How to add executable permissions to a text file xttblog.sh?

How to prevent other users from modifying xttblog.sh?

The second method: chmod [mode] filename. So far, we have used a mode called "symbol" to specify permission changes with chmod. However, there is also a commonly used way to specify permissions-using numbers to indicate the use of permissions. This usage is called numeric permission syntax, and each bit represents a permission triple.

The corresponding patterns and numbers are as follows:

Rwx:7

Rw-:6

R-x:5

RMULIMUTH 4

-wx:3

-wMuthPlul 2

-- XRO 1

-0

[mode] is a 3-digit octal number:

The first one represents the creator's permissions

The second bit represents the group user rights

The third bit represents other user permissions

More specifically:

400: creator readable

200: the creator can write

100: creator executable

040: group user readable

020: group users can write

010: group user executable

004: readable by other users

002: other users can write

001: other users can execute

The corresponding numbers of the three corresponding bits add up to the final permissions of the three types of users.

How do I reclaim all permissions on xttblog.sh from a non-creator user?

The first one is 7-7-4-4-2-1, creator, readable, writable and executable

Second 0: group users, no permissions

Third 0: other users, no permissions

Xttblog.sh only allows creators to modify, allow other users to read and execute, how to set it?

The first one is 7-7-4-4-2-1, creator, readable, writable and executable

The second bit is 5RV 4room1, group of users, readable and executable

The third bit is 5-bit 5-bit 4-bit 1, other users, readable and executable

Generally speaking, write a tool, only allow yourself to modify, do not allow others to modify, but allow others to use, this is 755.

The above is what the Linux Rights Management chmod 755 tutorial is like. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report