Home >Operation and Maintenance >Linux Operation and Maintenance >How to add root permissions to users in linux

How to add root permissions to users in linux

王林
王林Original
2020-01-10 16:24:082367browse

How to add root permissions to users in linux

Method 1: Modify the /etc/sudoers file, find the following line, remove the previous comment (#)

## Allows people in group wheel to run all commands
%wheel    ALL=(ALL)    ALL

and then modify the user so that it belongs to the root group (wheel), the command is as follows:

(free learning video tutorial recommendation: linux video tutorial)

#usermod -g root tommy

The modification is completed, you can now log in with the tommy account, and then use the command su -, you can obtain root permissions to operate.

Method 2: Modify the /etc/sudoers file, find the following line, and add a line under root, as shown below:

## Allow root to run any commands anywhere
root    ALL=(ALL)     ALL
tommy   ALL=(ALL)     ALL

After the modification, you can now log in with the tommy account, and then use the command su - , you can obtain root permissions to operate.

Recommended related articles and tutorials: linux tutorial

The above is the detailed content of How to add root permissions to users in linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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