The content originates from the people's post and Telecommunications press "Linux command Application big dictionary"
tell 729 commands, 1935 examples
Learn about the Linux system's reference books, desk book, encountered the command or command not understand the options can be found
Strive to publish content every day
Useradd Command
use the useradd command to create a user account in the system and assign the user UID, group, home directory, and login Shell resources to the new account. The newly created user account is locked by default and cannot be used until you use the passwd command to set the password.
Command syntax:
useradd [ options ] [ user name ]
The meanings of the options in the command are as follows is shown.
table useradd command options meaning
Options |
Meaning |
-D < home directory > |
Home directory to be used each time the new account is logged in |
-E < expiry date > |
set the expiration date of the account, plus the user account stop date, the date format is Mm/dd/yy |
-F < expiry date > |
Set the number of days after the password expires to close the account |
-C < username Full name > |
Set the full name of the user account |
-G < main group name > |
Specifies the primary group to which the user account belongs. The group name must be an existing name |
-G < secondary Group name > |
specifies that the user account is a member of multiple secondary groups. Each group uses "," to separate |
-M |
The user directory is automatically created if it does not exist |
-M |
do not establish user directory, even if /etc/login.defs file is set to create user directory |
-R |
Create a System user account. Does not establish a user home directory and does not respond to values defined in file/etc/login.defs |
-s <shell shell |
-U < user uid> |
User's The UID value. The number cannot be negative |
Example : Create user account Zhangsan.
[Email protected]~]# useradd Zhangsan
Example : Create user Moonand set the user UID to 510.
[Email protected]~]# useradd-u 510 Moon
Example : Create the user NewUser, and set the user's home directory to /home/www.
[Email protected]~]# useradd-d/home/www NewUser
Example : Create the user pp andspecify that the user's primary group is root.
[Email protected]~]# useradd-g Root pp
Example : Create user ABC, and set the user's Shell type to be /bin/ksh.
[Email protected] ~]# useradd-s/bin/ksh ABC
This article is from the "airfish2000" blog, make sure to keep this source http://airfish2000.blog.51cto.com/10829608/1871741
Useradd Command--linux command application of large dictionary 729 commands interpretation