Adding a User
To add a user to the system:
- Issue the useraddcommand to create a locked user account:
useradd <username>- Unlock the account by issuing the passwdcommand to assign a password and set password aging guidelines:passwd<username>Command line options for useraddare detailed in Table 35.1, "useraddCommand Line Options".Table 35.1.useraddCommand Line OptionsOption Description -c'<comment>'<comment>can be replaced with any string. This option is generally used to specify the full name of a user.-d<home-dir>Home directory to be used instead of default /home/<username>/-e<date>Date for the account to be disabled in the format YYYY-MM-DD -f<days>Number of days after the password expires until the account is disabled. If 0is specified, the account is disabled immediately after the password expires. If-1is specified, the account is not be disabled after the password expires.-g<group-name>Group name or group number for the user's default group. The group must exist prior to being specified here. -G<group-list>List of additional (other than default) group names or group numbers, separated by commas, of which the user is a member. The groups must exist prior to being specified here. -mCreate the home directory if it does not exist. -MDo not create the home directory. -nDo not create a user private group for the user. -rCreate a system account with a UID less than 500 and without a home directory -p<password>The password encrypted with crypt-sUser's login shell, which defaults to /bin/bash-u<uid>User ID for the user, which must be unique and greater than 499