Pawan Sharma | May 30, 2012 | 8 Comments so far

/etc/default/useradd (USER ADMINISTRATION)

User administration in Redhat Enterprise Linux (RHEL 6) is quiet interesting. When a user is created, different properties related to user are implemented, and these default user properties are stored in different files. User properties like, where user's home directory is to be created, what should be the user's shell, etc are taken from a file "user/default/useradd".

When useradd command executed, it takes some of user property values form a file called /user/default/useradd from where it gets the following values:


GROUP=100
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
CREATE_MAIL_SPOOL=yes


Description : -

1. GROUP: Maximum number of groups for which a user can be a member of.

2. HOME : Directory where the user's home directory will be created.

3. INACTIVE: Number of days the account should be inactive after creation.

   Note: "-1" means never inactive i.e. always active

4. EXPIRE: Date on which the account should expire. It is given in the form YYYY-MM-DD.

5. SHELL: Default login shell for the user.

6. SKEL: Directory from where the default user profile files will be copied to the user's home directory.

7. CREATE_MAIL_SPOOL:
This option ensures that a new user will have a directory of its user name in /var/main where the mail process can store mail messages. 

By editing this file from command line, you can change the default shell and directory containing home directories for new users on Linux Operating System.

8 comments:

  1. In group.. Is it maximum no of group a user can be member of? Because I heard it is 16

    ReplyDelete
  2. Replies
    1. Usermod -u id username

      If you want create customized uid

      useradd -u id username

      Delete
  3. difference between userdel and userdel -R

    ReplyDelete
    Replies
    1. If you delete the user by command userdel ,the user information removed in /etc/passwd but the user info still available in /home directory. Userdel -R username it will delete recursively

      Delete
  4. by using the userdel -R it will delete the user home directory also

    ReplyDelete
  5. If a user becomes inactive by setting values in inactive attributes then how to bring back the inactive user to active kindly someone help me

    ReplyDelete