In production, the habit is as follows:
Useradd, the default is to add a new user to the user group with the same name. For example, Useradd zhouls, after this command is executed, is added to the Zhouls user group with the same name by default.
However, in production, generally do not do so. Usually,useradd-m-G . Otherwise, when it appears, the user is established, but the home directory does not appear oh. Careful!!! ( important words, say three times )
####################in the CentOS system ##########################
In the CentOS system, the root user executes the
First step: Groupadd New user Group
Groupadd Hadoop This is the creation of a Hadoop user group
Step Two: Useradd-m-G created user group New user
Useradd-m-G Hadoop Hadoop This is a new Hadoop user and home directory that is also created and added to the Hadoop group.
Step three: passwd has created a user
passwd Hadoop Hadoop User Password
Changing password for user Hadoop
New Password:
Retype new Password:
###################################
###################ubuntu system in ###########################
Ubuntu system, root user execution, first how to open, see Ubuntu14.04 after installation of some configuration
First step: sudo groupadd new user group
sudo groupadd Spark This is the creation of the Spark user group.
Step two: sudo useradd-m-G created user group New user
sudo useradd-m-G spark Spark This is a new spark user and home directory also created and added to the Spark group.
Step three: sudo passwd user created
passwd Spark Spark User password
Changing password for user spark
New Password:
Retype new Password:
###################################
deleted, here, not much to repeat. corresponding to, for Userdel, can.
Modified, here, also not much to repeat. corresponding to, for Usermod, can.
New user group, user, user password, delete user group, user (for CentOS, Ubuntu system)