– To create/add new users into the system, Linux has a useradd command.
– useradd provides many options for creating users, we can create local, system or superusers using it.
– It comes from “shadow-utils-4.1.4.2” package, we have covered almost all the options here.
Examples:
1. Adding the user with the default settings
|
2. To add the user with mentioning comments
|
3. To add user with mentioning home directory
|
4. To add user with expiration date
|
5. To add user account with number of days of inactivity
|
6. To add user with specifying primary group to it
|
7. To add user with mentioning secondary groups to it
|
8. To add user while home directory will not be created for it
|
9. To create a user with duplicate UID
|
10. To create a system account
|
11. Creating user with assigning specific shell to him
|
12. Creating user with particular user ID
|
Related Commands: chfn, chsh, passwd, crypt, groupadd, groupdel, groupmod, login.defs, newusers, userdel, usermod. |