6. User Management

Use the useradd command to add users

The only required parameter for useradd is the user's login name. The available options for the useradd command include:

  • -c "comment here" Provides a description of the new user account
  • -d home_dir Set the home directory used by the account, the default is /home/username
  • -g group Set the primary group of the new user (must already exist). If this option is not used, a new group will be created (use the user name as the group name).
  • -G grouplist Add the new user to the comma-separated list of supplementary groups (if -G is used in the subsequent usermod, make sure to use -aG, otherwise, the existing supplementary group will be deleted)
  • -M Do not create a home directory
  • -o Use -u uid to create a user with the same UID as another user account

Guess you like

Origin blog.csdn.net/qq_45467083/article/details/109898303