Add User: UseraddAnd
GroupaddOr the system settings in the graphical interface
UseraddNOx # #不带-m parameter of the Useradd command does not establish a home directory for new users, in which case the user can log in to the shell and cannot log in to the graphical interface
passwdNOx # #设置nox用户的口令 Enter a new UNIX password: Reenter the new UNIX password: passwd: Password was successfully updated sudo
Useradd
- GUsers Mike # #
- GUsed to specify the user-owned
Group, create a user account for Mike and specify that it belongs to the Users group sudo
passwdMike # #为mike用户设置密码 (remember) sudo
useradd-s/bin/bash Mike # #
- SParameters are used to specify the user
Shell, # #常用的有BASH, TCSH, ZSH, SH, the default is sh (a symbolic link to bash, which can be found in/bin. Sudo
GroupaddNewGroup # #在系统中添加名为newgroup的组
Record User actions: History (used only in bash)The shell logs each user's command, and through the history command, the user can see the actions they have performed, the user's home directory
. Bash_hitoryFile, default record 1000
History(number) # #看最近 The record of the (number) bar.
edit passwd and shadow files directlyAll user information will be registered in
/etc/passwdFile, and
/etc/shadowThe file keeps the user's login password
Delete User: UserdelSudo
UserdelMike # #不会删除用户主目录 Sudo
Userdel
- RJhon #-R Delete account while deleting home directory
Manage user accounts: UsermodSudo
Usermod
- LMike
- D/home/mike
- e12/31/12 John # #将john changed to Mike, the home directory is changed to/home/mike, and the account is valid for December 31, 2013-D Modify user home directory-e Repair The expiry date of the account change. Expressed in the form of AD month/day/year (MM/DD/YY); -G Modify the group that the user belongs to-l modify the user account name-s to modify the shell used by the user after login
View user information: ID
ID(user name) # #不带用户名时, displays the current logged in user information
switching between users: Su
suJohn
/etc/passwd fileEach row consists of 7 fields, representing a user, separating logins with colons, password placeholders, user ID numbers (UID), default group ID number (GID), user's personal letter: including full name, office public office, work telephone, home phone, etc.; log in to the shell
/etc/group fileEach row represents a user, and each field is separated by a colon. Only the user name and password fields are required to be non-empty. Login name, password after encryption, date of last change of password, number of days between password change (minimum), two times between password changes (maximum), number of days in advance to remind user to change password (absolute date from
January 1, 1970days to date); Disable the account number days after the password expires (absolute date from
January 1, 1970Days to date, you can use
usermod CommandSet expiration field); Date when the account expires; reserved, currently empty.
/etc/group fileSave the names of all the groups on the system, as well as the list of members in each group. Each row in the file represents a group, four field group names, group password placeholders, group ID (GID) numbers, member lists separated by commas (no spaces) ———————— refer to the Linux import Door to Mastery "Liu Chihi
Linux User and user management