CentOS7服务器添加新用户

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

猜你喜欢

转载自www.cnblogs.com/jeshy/p/10519391.html