Home  >  Article  >  Operation and Maintenance  >  How to create a new user and password in linux

How to create a new user and password in linux

藏色散人
藏色散人Original
2023-01-03 11:11:5540310browse

How to create a new user and password in Linux: 1. Log in to the terminal command window; 2. Create a new user and password by executing the "useradd -u 6666 -d /root/admin admin" and "passwd admin" commands That’s it.

How to create a new user and password in linux

#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.

How to create a new user and password in Linux?

Create a new user in Linux, set the ID and password

For example: create a new user admin, specify it in the /root home directory, and specify the user ID as 6666, set password: admin@123

Add user

 add:用于创建新的系统用户

Syntax: useradd[option] Username

-d specifies the user’s home directory (The default username directory is /home/username, and the root username home directory is /root)

-g specifies the group to which the user belongs

-M does not automatically create a user login directory (default The user login directory is the user's home directory)

-u specifies the user id

passwd is used to set/modify the user password passwd [user name]

whoami is used to display the current login Enter the user name of the system

(For user security, the password input will not be displayed)

How to create a new user and password in linux

Recommended study: "Linux Video Tutorial

The above is the detailed content of How to create a new user and password in linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn