12.07.2015 Views

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Managing Users 209TABLE 9.1Options for useraddCommand-Line OptionDescription-c Full name of the user (or a comment about the user). If more thanone word is needed, place quotation marks around the value.-d Home directory for the user. The default value is /home//.-e Date on which the user account will expire and be disabled. Usethe format YYYY-MM-DD (default: never expire or disable).-f Number of days after the password expires until the account will bedisabled. 0 disables the account immediately after the passwordexpires. -1 disables this feature (default: -1).-g Default group for the user specified as a group name or group IDnumber. The group name or GID must already exist. The default isto create a private user group. If a private user group is notcreated, the default is the users group.-G Comma-separated list of additional group names or GIDs to whichthe user will be a member. Groups must already exist.-M Do not create a home directory for the user. By default, a homedirectory is created unless this option is used or unless the directoryalready exists.-m Create a home directory for the user if it doesn’t exist. Files from/etc/skel/ are copied into the home directory.-n Do not create a private user group for the user. By default, a privateuser group is created for the user.-o Allow the creation of a user with a UID that already exists foranother user. By default, the UID must be unique.-p Specify an encrypted password for the user as returned by thecrypt utility. By default, the account is locked until the passwdcommand is used to set the user’s password.-r Add the user as a system user with a UID below 500 and with apassword that never expires. The user’s home directory is notcreated unless the -m option is used. The default is UID 500 orhigher for a non-system user.-l Do not add the user to the last login log file. The default is to addthe user to the last login log file.-s Specify the user login shell for the user. The default shell if notspecified is /bin/bash.-u Integer to use for the user ID. Must be unique unless -o is used.Values less than 500 are reserved for system users.9Modifying UsersThe usermod command can also be used to modify options for an existing user with theusermod command. Most of the useradd options from Table 9.1can be used with usermod. Table 9.2 lists additional usermod options.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!