User operation at present is not a lot of use, in order to facilitate the later to read or tidy it up.
Useradd User Add Command:
Format: useradd [options] USERNAME. Some of the most common options are:
1)-R Create system user for example: useradd-r MySQL creates a MySQL system user, the system user is not home directory.
2)-C Add comment information for new user. After that, you can use the CHFN command to add
3)-d specifies the home directory for the user. If the directory exists, there will be a warning
4)-m not allowed to create its home directory when creating a user
5)-u user specified when creating user id,useradd-u Test1 Create test1 user whose ID is 600
6)-g Specifies the user base group when the user is created, default to the same group as the user name, and if this option is used, the base group specified must be a group that already exists.
7)-g Specifies the user-attached group when creating a user, by default the same as its base group, if you want to specify multiple additional groups use commas to separate each group for example: Useradd-g test1,test2 Test creates a user test user.
8)-e Specify user disabled date when creating user, use Format: Useradd-e yyyy-mm-dd USERNAME
9) The number of days before the account is disabled after the-F password expires. 0 means disable now-1 to disable the inactive period feature.
-S to create a specified shell for the user, you can use "cat/etc/shells" to view the shells available to the current system
2. Userdell User Delete command:
Format: Userdel [options] USERNAME
Deleting a user command is a simple option with only one "-R"
Userdel test1 Delete test1 user, the default is not to delete the user home directory.
Userdel-r test1 Delete test1 user, and its home directory is deleted together.
3. Usermod Modify user command:
Format: usermod [options] USERNAME. Common options are:
1)-L Modify User login name: usermod-l test1 test2 Modify user test1 to Test2
2)-U Modify user id:usermod-u 789 test1 Modify user Test1id to 789
3)-M Mobile User home directory to a new location, usually with the-D option
4)-L Lock user account
5)-U unlock user account
6)-e Set user account expiration date
7)-F account expires after the specified number of days, the account password is invalid status
8)-G Modify user Attach group is generally used in conjunction with the-a option, otherwise the original account additional group will be overwritten
Tomorrow, add the chage order.
This article from "Product small stream, into Jianghai" blog, please be sure to keep this source http://goodjoe.blog.51cto.com/9173556/1669097
User Action commands for CentOS learning notes