In Linux, the root user is a user with a high level of permissions, which threatens the security of the operating system, therefore, we usually use a common user name when operating the computer, and temporarily use the su command to switch to the root user only when super user permissions are set in some cases. But sometimes I don't want my root password to be told, but I also want to know how to do operations that exceed the security level of common users. At this time, I used the sudo command.
The sudo Command actually improves the running level of the current Command executed by the current user. For example, you need to edit a system configuration file, but only the root user can edit it. The common user is in read-only status, at this time, if you add sudo before your editing command, the execution gives you the permissions of the Super User. After entering sudo, you will find that the system requires you to enter the password. This is not the root user password, but the current login user password. If the password is correct, command.
It doesn't mean that any user can use the sudo command to obtain Super User Permissions. The premise is that you must be in the sudo user group. How can this group be defined, this user group can be configured in the/etc/sudoers file. If you want to add user1 To The sudo user group, you only need to copy the line configured by root, then change the root user name to user1. At this time, you can successfully find that the user user1 can be operated using the sudo command.