CentOS7服务器添加新用户

添加新用户

root权限:
[root@localhost ~]# adduser jiangshan
[root@localhost ~]# passwd jiangshan
[root@localhost ~]# chmod -v u+w /etc/sudoers
mode of ‘sudoers’ changed from 0440 (r--r-----) to 0640 (rw-r-----)
[root@localhost ~]# vim /etc/sudoers
在root ALL=(ALL) ALL行后,添加以下行
[用户名] ALL=(ALL) ALL(如需新用户使用sudo时不用输密码,把最后一个ALL改为NOPASSWD:ALL即可)
[root@localhost ~]# chmod -v u-w /etc/sudoers
mode of ‘sudoers’ changed from 0640 (rw-r-----) to 0440 (r--r-----)

原文地址:https://www.cnblogs.com/jeshy/p/10519391.html