The Linux Newbie Guide  ⇒    Fundamentals     Advanced     Supplement   Command Index   ENG⇒中
All rights reserved, please indicate the source when citing
  

useradd - Add User Accounts





The useradd command is used to add new user accounts on a Unix-like operating system. It is typically executed by the superuser (root) as it involves creating user accounts and modifying system files.

The basic syntax for the useradd command is as follows:
useradd [OPTIONS] USERNAME

Here, "USERNAME" is the name of the new user account you want to create.

Some of the most commonly used options for the useradd command include:


For example, if you're logged in as the root user:
useradd -m connie ←Creates a user account named "connie" and automatically creates a home directory with the same name
useradd -g rd suuny ←Creates a user account named "sunny" and assigns it to the "rd" group

For more details on the useradd command and additional examples, you can refer to the provided link.