Home > Backend Development > PHP Tutorial > chmod command - the difference between chmod 755 and chmod 4755_PHP tutorial

chmod command - the difference between chmod 755 and chmod 4755_PHP tutorial

WBOY
Release: 2016-07-14 10:11:22
Original
1527 people have browsed it

The difference between 755 and 4755

chmod is a command to set file permissions under Linux. The following numbers indicate the permissions of different users or user groups.

Usually three numbers:
The first number indicates the permissions of the file owner
The second number represents the permissions of other users who belong to the same user group as the file owner
The third number indicates the permissions of other user groups.

There are three types of permissions: read (r=4), write (w=2), and execute (x=1). In summary, there are readable and executable (rx=5=4+1), readable and writable (rw=6=4+2), and readable, writable and executable (rwx=7=4+2+1).

So, chmod 755 sets the user’s permissions to:

1. The file owner can read, write and execute
2. Other users who belong to the same user group as the file owner can read and execute
3. Readable and executable by other user groups

The difference between chmod 4755 and chmod 755 is that there is one more digit at the beginning. This 4 means that when other users execute the file, they have the same permissions as the owner.

For example: the root user has created an Internet authentication program netlogin. If other users also need to use this program to access the Internet, the root user needs to run the chmod 755 netlogin command so that other users can also run netlogin.

However, when executing netlogin, you may need to access some files that only the root user has access to. Then other users may not be able to access the Internet due to insufficient permissions when executing netlogin.

In this case, you can use chmod 4755 netlogin to set other users to have root user permissions when executing netlogin, so as to access the Internet smoothly.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/477383.htmlTechArticleThe difference between 755 and 4755 chmod is the command to set file permissions under Linux. The following numbers represent different users or user groups permissions. Generally three numbers: The first number indicates all files...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template