[Linux] User Management: Create a User-Specified Password

User management (create user-specified password)

basic introduction

User home directory : The directory contains the home directory /home/of each created user. When the user logs in, they will automatically enter their home directory.

Add user

useradd [选项] 用户名[options], can be omitted

Example: useradd xmAn xm account was created because we did not specify the group of the xm account. Linux automatically creates an /homexm , and xm belongs to the xm group.

note

  1. When the user is successfully created, a home directory with the same name as the user will be automatically created

  2. It is also possible useradd -d 指定目录 新的用户名to specify a home directory for the newly created user.

    Example:useradd -d /home/dog xq

Set or change password for user

passwd 用户名

switch user

su 用户名

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325478156&siteId=291194637