The simple principle of sudo commands in CentOS

Source: Internet
Author: User
① The security minimization principle of Linux optimization: the general user's authorization permission is minimized, that is, only necessary management system commands are provided. Therefore, the general user Enn cannot create files here: similarly, you cannot execute administrator commands such as useradd to create a new common user: the permissions of common users are actually minimized. you can only view files and even rm-f (directly force delete files) none: & n

① Knowledge from the principle of minimal security for Linux optimization: Grant the minimum permissions to common users, that is, Grant only necessary management system commands.

Therefore, the normal user Enn cannot create files:

 

Similarly, you cannot run the administrator command, such as useradd, to create a common user:

 

In fact, the permissions of common users are minimized. they can only view files and cannot even execute rm-f (directly force delete files:

 

② Grant more permissions to the general user Enn:

Revoke do (precise user authorization)

 

Grant all permissions to the normal user Enn:

 

With the sudo command, Enn, a common user with all permissions, can successfully use the useradd command to create a new common user You:

 

Ps: a vivid picture of the difference between su and sudo is appended:

 

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.