Useradd command Explanation

Source: Internet
Author: User

Useradd

function:
for new system users created in Linux, Useradd can be used to set up user accounts, after the account is built, and then use passwd to set the password of the account, you can Userdel delete the account. The account created with the useradd instruction is actually saved in the/etc/passwd text file.
options:
-
C: Note text, displayed in the passwd comment field-
D: Specifies the starting directory for user login-
d: Change preset
-e: Specify the expiration date of the account-
F: Specify the number of days after the password expires
-G: Specify the group to which the user belongs
g: Specify the additional group to which the user
is a-
m: automatically establish the user's login directory-
N: To cancel the creation of a group with the name of the user
-
R: Establish the SYSTEM account
-
s: Specify the shell-
u: Specify the user ID
of the user logged in
Example:
useradd-g Sales jack-g Company, Employees//-G Join the main group,-G join the affiliate group
useradd caojk-u 544//Create a new user, specify ID
useradd-d/usr/sam-m Sam//Build a user Sam to generate the home directory/usr/sam.
useradd-s/bin/sh-g group-g adm, Root gem//new gem user, login shell is/bin/sh, primary group is group, subordinate group is root,adm

Useradd command Explanation

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.