Home > Operation and Maintenance > CentOS > What should I do if the root permissions of centos7 are not enough?

What should I do if the root permissions of centos7 are not enough?

coldplay.xixi
Release: 2020-06-24 11:47:52
Original
13134 people have browsed it

What should I do if the root permissions of centos7 are not enough?

centos 7 Solution to insufficient root permissions:

1. Add an ordinary user, the command line steps are as follows:

(1)useradd wy99--Add a user named wy99

(2)passwd wy99- -Change the password for user wy99

After pressing Enter, the following information appears on the command line (just fill in the password in order):

(3) Changing password for user wy99.

New UNIX password--Enter the new password here (when entering the password, the default is to hide the input state)

Retype new UNIX password- -Enter the new password again (if the passwords entered twice are consistent, the change can be successful)

passwd: all authentication tokens updated successfully

su wy99--Switch to wy99 User

In this way, the creation process of an ordinary user is over.

2. Ordinary users are upgraded to administrator users. The command line steps are as follows:

At this point, we will find that ordinary users are often not satisfied with their own needs. For example, the reading and writing of certain files and file directories will be restricted, so we also need to give wy99 users a way to upgrade VIP users, then look at the following code:

Method 1:

vi /etc/sudoers  --  修改/etc/sudoers文件,找到下面一行,把前面的注释(#)去掉
## Allows people in group wheel to run all commands
#%wheel              ALL=(ALL)               ALL (此处标红的井号去掉即可)
Copy after login

Method 2: After

vi /etc/sudoers  --  修改/etc/sudoers文件,找到下面一行,在下面加入一行代码
## Allow root to run any commands anywhere
root              ALL=(ALL)               ALL
wy99            ALL=(ALL)               ALL(加入此行代码)
Copy after login

is modified, use the command su wy99 to switch users.

The method to modify user read and write permissions is as follows:

-- Modify a single file (folder)

chown或chmod    “权限”或“名:组”    文件(夹)名称
Copy after login

-- Modify all files in the folder and subfolders

chown或chmod  -R   “权限”或“名:组”    文件夹名称
Copy after login

Recommended tutorial: "centos tutorial"

The above is the detailed content of What should I do if the root permissions of centos7 are not enough?. 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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template