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-----)

posted @ 2019-03-12 20:21  土博姜山山  阅读(887)  评论(0编辑  收藏  举报