user
- Description:
1) Linux system is a multi-user multi-tasking operation, any need to use the resources of the system of accounts, are subject to prior Xianxiang system administrator for an account, login to the system after the identity of the account.
2) Linux users must belong to at least one group.
Add User
- The basic syntax for useradd [option] username
- When the user is created, automatically creates a home directory and user of the same name
- Can be specified in the user's home directory on the user's common when using useradd -d
Example: Create a user named js, and assign the home directory is / home / web
The user is assigned a password or change the password
- The basic syntax for passwd username
Case: Set a password for the user just created, and switch to the user (Note: does not require highly privileged users to switch to low-rights user input commands)
delete users
- The basic syntax userdel username
Case: delete user js, but retain the home directory (when removed, use the -r option when it will be removed along with the home directory)
User queries and switching
- The basic syntax of the query id user name
- Switching basic usage su username
- When you need to return to the original user's input when you can exit
user group
Management mechanism system, unified management of multiple users
Creating user groups
- The basic syntax groupadd group name
Deleting User Groups
- The basic syntax groupdel group name
Directly specify the user group increases user
- The basic syntax for useradd -g users username
Case: Creating a user group web and then create users and assign user group web
Modifying User Groups
- The basic syntax usermod -g User Group User
Case: Creating user groups web1 it js user groups to modify web1
Relevant documents (using the cat command with the path to view)
/ Etc / passwd file
User's profile, the user record a variety of information
in each row meanings: login: password: user ID: Group ID: Annotated Description: home directory: login shell
/ Etc / shadow file
Password profiles
the meaning of each line: login: password encryption: Last modified: maximum time interval: Warning time: No Time: Time: Identity
/ Etc / group file
Group profile, record the information contained in the Linux group
per line meaning: group name: password: Group ID: the list of users within the group
while studying records, if any deficiencies welcome message pointing ...