Home >Operation and Maintenance >CentOS >How to grant root permissions to ordinary users in centos

How to grant root permissions to ordinary users in centos

王林
王林Original
2020-05-19 15:16:575158browse

How to grant root permissions to ordinary users in centos

Methods to grant root permissions to ordinary users:

1. To add a user, first use the adduser command to add an ordinary user. The command is as follows:

#adduser tommy      //添加一个名为tommy的用户
#passwd tommy       //修改密码
Changing password for user tommy.
New UNIX password:                //在这里输入新密码
Retype new UNIX password:         //再次输入新密码
passwd: all authentication tokens updated successfully.

2. Modify the /etc/sudoers file, find the root user 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 Command sudo su - to obtain root permissions to operate.

Recommended tutorial: centos tutorial

The above is the detailed content of How to grant root permissions to ordinary users in centos. 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