添加新用户
sudo su root restart: sudo reboot
root@worker:/home# useradd -r -m -s /bin/bash spark
root@worker:/home# passwd spark
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
root@worker:/home# ls
kuku spark
root@worker:/home#
若想给新用户添加root权限,则
root@worker:/home#chmod +w /etc/sudoers
root@worker:/home# vim /etc/sudoers
添加
保存即可!
若想删除某个用户,则
root@worker:/home# userdel -r spark
userdel: spark mail spool (/var/mail/spark) not found
root@worker:/home# ls
kuku
root@worker:/home#
即可