添加用户
[root@劫系侠 ~]# useradd chen
设置密码
-e参数使用户下次登录必须修改密码
[root@劫系侠 ~]# passwd chen
#设置密码
[root@劫系侠 ~]# passwd chen -e
添加root权限
# 修改权限
[root@劫系侠 etc]# chmod -v u+w /etc/sudoers
mode of '/etc/sudoers' changed from 0440 (r--r-----) to 0640 (rw-r-----)
# 设置sudu免密
[root@劫系侠 etc]# vi /etc/sudoers
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
chen ALL=(ALL) NOPASSWD:ALL
# 改回权限
[root@劫系侠 etc]# chmod -v u-w /etc/sudoers
mode of '/etc/sudoers' changed from 0640 (rw-r-----) to 0440 (r--r-----)
# 修改用户组
[root@劫系侠 etc]# usermod -g root chen