How to add new users in centos7

王林
Release: 2020-05-23 14:24:00
Original
5595 people have browsed it

How to add new users in centos7

1. Create a new user

adduser [用户名]
Copy after login

2. Modify the password of the new user

passwd [用户名]
Copy after login

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

4. Open the sudoers file in the vim editor

vim /etc/sudoers
Copy after login

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

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

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!

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!