How to add root permissions to users in linux

王林
Release: 2020-01-10 16:24:08
Original
2261 people have browsed it

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
Copy after login

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
Copy after login

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
Copy after login

After the modification, you can now log in with the tommy account, and then use the commandsu -, 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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!