Home > Article > Operation and Maintenance > 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!