Article Title: Linux User and user group management commands. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Linux is a multi-user multi-task time-sharing operating system. any user who wants to use system resources must first apply for an account from the system administrator and then enter the system as the account. User Accounts can help system administrators track users who use the system and control their access to system resources. They can also help users organize files and provide security protection for users.
1. useradd
The useradd command creates a new user account. Its basic usage is
Useradd Username
Enter the following command
Useradd newuser
Linux operation guide topic documentation confidential internal Disclosure
The system will create a new user newuser whose Home directory is/home/newuser
The parameters of the useradd command are often combined
Useradd username-g group name? G group name-d Home directory name-p Password
-G specifies the Primary Group of the user.
-G: Specifies the secondary group of the user.
-D: Specifies the Home Directory of the user.
-P specifies the password of the user.
Enter the following command
Useradd oracle? G oinstall? G dba? D/home/oracle? P ora123
The system will create an oracle user whose primary group is oinstall and whose secondary group is dba.
The/Home/oracle password is ora123 in the home directory.
2. userdel
The userdel command is used to delete an existing account. Its usage is
Userdel Username
3. groupadd
The groupadd command creates a new user group. Its most basic usage is
Groupadd group name
Enter the following command
Groupadd newgroup
The system will create a new user group newgroup
[1] [2] [3] Next page