Linux Command Encyclopedia useradd command

The Linux useradd command is used to create user accounts.

useradd can be used to create user accounts. After the account is created, use passwd to set the password of the account. Instead, userdel can be used to delete the account. The accounts created with the useradd command are actually stored in the /etc/passwd text file.

grammar

useradd [-mMnr][-c <备注>][-d <登入目录>][-e <有效期限>][-f <缓冲天数>][-g <群组>][-G <群组>][-s <shell>][-u <uid>][用户帐号]

or

useradd -D [-b][-e <有效期限>][-f <缓冲天数>][-g <群组>][-G <群组>][-s <shell>]

Parameter description :

  • -c<comment> Add comment text. The remark text will be saved in the remark field of passwd.
  • -d<login directory> specifies the starting directory when the user logs in.
  • -D Change the default value.
  • -e <expiration period> Specify the validity period of the account.
  • -f<buffer days> Specifies how many days after the password expires the account will be closed.
  • -g<group> Specifies the group the user belongs to.
  • -G<group> Specifies additional groups to which the user belongs.
  • -m specifies the user's login directory.
  • -M Do not automatically create the user's login directory.
  • -n cancels the creation of a group named after the user name.
  • -r Create a system account.
  • -s<shell> specifies the shell that the user logs in with.
  • -u<uid> Specifies the user ID.

Guess you like

Origin blog.csdn.net/m0_37449634/article/details/131432099