April 19, 2016 Useradd/du/df/passwd/usermod command

Source: Internet
Author: User

First, Useradd command

Useradd Command-m-u-s-g Common
-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. (Modify default configuration file)
-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.





-e expire_date account termination date. The specified format for the date is mm/dd/yy.
-F Inactive_days Account expires a few days after the permanent stop right. The account number at 0 o'clock is immediately deactivated. This function is turned off when the value is-1, and the default is-1
-G Initial_group group name or number as the user Login start Group (group). The group name must be a name that exists already. Group numbers are also required for existing groups. The preset group number is 1.
-G group,[...] defines this user as a member of this heap of groups. Each group uses the "," area, and cannot be mixed with blank characters. The group name is limited to the-G option. Defines the starting group for which the value is a consumer.
-M user directory is automatically created if it does not exist. If you use the-K option, the files within the Skeleton_dir will be copied to the user directory. However, files in the/etc/skel directory will also be duplicated in the past. Any directories in the Skeleton_diror/etc/skel are also created in the user directory. The-k with-M does not establish directories and does not copy any files as presets.
-M does not establish a user directory, even if the/etc/login.defs system file is set up to create a user directory.

-U uid The user's ID value. Must be a unique ID value unless the-o option is used. The number cannot be negative. The preset is not less than 999 and increases successively. 0~999 is traditionally reserved for use in system accounts. Changing the preset worth-D option appears, Useradd shows the default value now, or updates the preset with the command column

-e default_expire_date user account stop date.
-F default_inactive account expires several days after the stop right.
-G Default_group New account start group name or ID. The group name must be a name that exists already. The group ID must also be an existing group.
/etc/skel file. bash_loght. bash_profile. BASHRC user's initial directory for storing files
/etc/default/useradd the default setting when adding users. Initializes the settings file with the specified parameter precedence
Groupadd Add Group command-G
Related Paths/etc/shadow shadow-
passwd--stdin
-N two times minimum number of days for password modification
-X two times the maximum number of days for password modification
How long after the-I password expires prohibit login use
-W Prompt user How many days prompt to change password
Min Max Inactive Warning
Summary of User management commands:
1, and user-related configuration file knowledge points:
/etc/passwd account files and different column contents
/etc/shadow account password file and different column contents
/etc/group groups of files and different column contents
/etc/gshadow group password file and different column contents
2. User Management commands
Useradd-u-g-g-s-m-e-c-D
Correspondence/etc/skel,/etc/default/useradd,/etc/login.defs
Userdel-r
Usermod-u-g-g-s-m-e-c-d-l-u-l
Id
Chage-l-e-m-w-m-I.
passwd--stdin-n-i-w-X (suid-bit focus)
Su
Sudo
Visudo

Second, Usermod command

Usermod can modify user groups to increase user outreach projects

-G Expansion group u specify ID G start ID

Usermod-u 500-g 512-g 522 user1

2.USERMOD-L Carlton Lock

Usermod-u Unlocking

Iii. passwd Order

passwd + Username If it is the root user, do not add

Yum-y Install expect installation package

After the installation is done

MKPASSWD automatically generate passwords

Iv. DF Command

Df-t Viewing the file system type

DF does not look like a swap partition, you need to use free to see

Df-h can know how much the partition uses

Df-k in k units

Df-i viewing the usage of inode

V. du command

Du is mainly looking at the size of the file

Du-m in units of M

Du-h can be randomly displayed according to the size of the file

Du-sh/file path/size of the specified file

The main difference between Ls-ih and Du-sh is that the former is looking at the file itself and the latter from disk

April 19, 2016 Useradd/du/df/passwd/usermod command

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.