The--useradd of Linux commands

Source: Internet
Author: User

The Useradd command is used to establish the user account and create the user's starting directory, and the use of permissions is the ultimate user. Useradd can be used to create user accounts, and he and AddUser commands are the same. After the account is built, use passwd to set the password for the account. The account created by using the Useradd command is actually saved in the/etc/passwd text file.


Language method:

Useradd (option) (User name)


Common choices:

-C: Add note text, note text is saved in passwd's remarks column.

-D: Specifies the start directory at which the user logged in.

-D: Change the preset value.

-e: Specifies the expiration date of the account and the default is permanent.

-F: Specify the number of days after the password expires to close the account.

-G: Specifies the starting group to which the user belongs.

-G: Specifies the additional group to which the user belongs.

-M: Automatically establish the user's login directory.

-M: Do not automatically create a user's login directory.

-N: Cancels the creation of a group named after the user name.

-R: Set up the system account.

-S: Specifies the shell to use when the user is logged in.

-U: Specifies the user ID number.


Application Examples:

Create a new user account and set the ID:

#useradd Username-u 544

It should be stated that the ID value should be set as much as 500 to avoid conflicts. Because the Linux installation will create some special users, generally 0 to 499 of the value between the bin, mail, such as the system account.


#useradd user1-g oinstall-g dba


Create a new User1 user, which initially belongs to the Oinstall group, and also makes him part of the DBA group.


This article is from the "10858195" blog, please be sure to keep this source http://10868195.blog.51cto.com/10858195/1952671

The--useradd of Linux commands

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.