Here are some common options for the useradd command:
-
-d: Specify the home directory for the new user.sudo useradd -d /path/to/home username -
-s: Specify the login shell for the new user.sudo useradd -s /bin/bash username -
-G: Add the user to supplementary groups.sudo useradd -G group1,group2 username -
-e: Set an expiration date for the user account.sudo useradd -e YYYY-MM-DD username -
-r: Create a system account (no home directory is created by default).sudo useradd -r username -
-p: Set the password for the new user (the password should be encrypted).sudo useradd -p encrypted_password username -
-m: Create the user's home directory (as previously mentioned).sudo useradd -m username
These options can be combined to customize the user creation process according to your needs.
