Home  >  Article  >  Operation and Maintenance  >  How to add new users in centos7

How to add new users in centos7

王林
王林Original
2020-05-23 14:24:005667browse

How to add new users in centos7

1. Create a new user

adduser [用户名]

2. Modify the password of the new user

passwd [用户名]

Because the newly created user does not The sudo command cannot be used, so we need to add authorization to it.

3. Add writable permissions to the sudoers file

chmod -v u+w /etc/sudoers

4. Open the sudoers file in the vim editor

vim /etc/sudoers

in the sudoers file Find the following location and add the following content:

[用户名] ALL=(ALL)    ALL(如需新用户使用sudo时不用输密码,把最后一个ALL改为NOPASSWD:ALL即可)

Recommended tutorial: centos tutorial

The above is the detailed content of How to add new users in centos7. 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