Chmod command -- difference between chmod 755 and chmod 4755

Source: Internet
Author: User

Differences between 755 and 4755

Chmod is a command for setting file permissions in Linux. The following numbers indicate permissions of different users or user groups.

Generally, there are three numbers:
The first number indicates the permission of the file owner.
The second number indicates the permissions of other users in the same user group as the file owner.
The third digit indicates the permissions of other user groups.

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

Therefore, chmod 755 sets the user's permissions:

1. The file owner can read, write, and execute
2. Other users in the same user group as the file owner can read and execute
3. Other user groups can be read and executed

The difference between chmod 4755 and chmod 755 is that there is one more character at the beginning. This 4 indicates that other users have the same permissions as the owner when executing files.

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

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

In this case, you can use chmod 4755 netlogin to set the permissions of other users to execute netlogin, so that they can access the Internet smoothly.

 

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.