Useradd Command--linux command application of large dictionary 729 commands interpretation

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.