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:
# 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.