Home > Article > Operation and Maintenance > 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!