sudo configuration file The default configuration file for sudo is /etc/sudoers. Generally, the Linux-specified editing tool visudo is used. The advantage of this tool is that it can perform error checking. When adding rules that do not conform to the syntax rules, an error message will be prompted when saving and exiting. After configuration, you can switch to the authorized common user and use sudo -l to check which commands are executable or prohibited. Each line in the /etc/sudoers file is a rule. The # sign in front of it is considered a comment and is not executed. If the rule is very long, it can be written in multiple columns and the \ sign can be used to continue the line. The rules in /etc/sudoers can be divided into two categories: one is authorization rules, and the other is alias definitions. Alias definitions are not required, but authorization rules are required. Enter the root user and open the sudoers file # # This file MUST be edited with the 'visudo' command as root. # # Please consider adding local content in /etc/sudoers.d/ instead of # directly modifying this file. # # See the man page for details on how to write a sudoers file. # Defaults env_reset Defaults mail_badpass Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" # Host alias specification # User alias specification # Cmnd alias specification # User privilege specification root ALL=(ALL:ALL) ALL # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL # See sudoers(5) for more information on "#include" directives: #includedir /etc/sudoers.d Example 1: To add sudo privileges to ordinary user lin, add the following line (user name ALL=(ALL) ALL) below the line "root ALL=(ALL)ALL" and save the file. Example 2: How to allow ordinary user lin to have the permission to restart the /etc/init.d/nagios script Example 3: Allow ordinary user lin to have all superuser privileges without having to enter a password The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Common front-end JavaScript method encapsulation
>>: Detailed explanation of MySQL slow log query
Table of contents use Use of EsLint Add a profile...
This article shares the specific code of JavaScri...
1. The role of index In general application syste...
Table of contents Update the image from an existi...
What is an index? An index is a data structure th...
Table of contents 1. Digital Operation (1) Genera...
Recently, when I was working on monitoring equipm...
Step 1: Enter the directory: cd /etc/mysql, view ...
Original configuration: http { ...... limit_conn_...
In HTML, the Chinese phrase “學好好學” can be express...
MySQL storage engine overview What is a storage e...
Table of contents Docker custom network 1. Introd...
Table of contents 1. Basic overview of the proces...
I saw this question in the SQL training question ...
XML/HTML CodeCopy content to clipboard < div c...