Add new users under Ubuntu16.04
In some cases, ubuntu uses the new user name of useradd, and you cannot see the newly created user folder under the home folder, for example:
Root@worker:/home/kuku# useradd sparkroot@worker:/home/kuku# passwd sparkEnter new UNIX password: Retype new UNIX password: passwd: password updated successfullyroot@worker:/home/kuku# cd.. root@worker:/home# lskukuroot@worker:/home#
It is found that the folder for spark cannot be found, so it will be re-established in the following way
Delete the spark user first
Root@worker:/home# userdel sparkroot@worker:/home# useradd-r-m-s / bin/bash sparkroot@worker:/home# passwd sparkEnter new UNIX password: Retype new UNIX password: passwd: password updated successfullyroot@worker:/home# lskuku sparkroot@worker:/home#
If you want to add root permissions to a new user,
Root@worker:/home#chmod + w / etc/sudoersroot@worker:/home# vim / etc/sudoers
Add
Just save it!
If you want to delete a user,
Root@worker:/home# userdel-r sparkuserdel: spark mail spool (/ var/mail/spark) not foundroot@worker:/home# lskukuroot@worker:/home#
Can