Linux creates accounts and automatically generates files in home directory and home directory

Source: Internet
Author: User

useradd-d/home/test-m test;

passwd test;

Then set the password to test.

1. Useradd Add users or update default information for newly created users

Syntax: useradd  option user name

The options for this command have the following meanings:

-C Comment    describes the new user account, usually the user's full name and comment as a string. -D home_dir   sets the user home directory, the default is the user's login name, and is placed in the/O directory. -D            Saves the default information for the new account setting after the new account is created. -e expire_date  Set the account expiration date in mm/dd/yyyy format. -F Inactivity   sets the password expiration time, which is 0 invalidates the password payback immediately, and 1 invalidates the option. -G group      sets the base group for which the new user is to be created, group name. -K Skel_dir   sets the framework directory, which contains the user's initial profile, and the              files under that directory are copied to the user's home directory when the user is created. -M   automatically creates the user home directory and copies the files under the framework directory (default =/etc/skel) to the user's home directory.   -M does not create a user home directory.   -R allows reserved system accounts to create a new account with the user ID. -S Shell    Specifies the user's login shell. -U user_id  

Linux creates accounts and automatically generates files in home directory and home directory

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.