Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

33.6. Explaining the Process

The following steps illustrate what happens if the command useradd juan is issued on a system that has shadow passwords enabled:

  1. A new line for juan is created in /etc/passwd. The line has the following characteristics:

    • It begins with the username juan.

    • There is an x for the password field indicating that the system is using shadow passwords.

    • A UID at or above 500 is created. (Under Red Hat Enterprise Linux, UIDs and GIDs below 500 are reserved for system use.)

    • A GID at or above 500 is created.

    • The optional GECOS information is left blank.

    • The home directory for juan is set to /home/juan/.

    • The default shell is set to /bin/bash.

  2. A new line for juan is created in /etc/shadow. The line has the following characteristics:

    • It begins with the username juan.

    • Two exclamation points (!!) appear in the password field of the /etc/shadow file, which locks the account.

      NoteNote
       

      If an encrypted password is passed using the -p flag, it is placed in the /etc/shadow file on the new line for the user.

    • The password is set to never expire.

  3. A new line for a group named juan is created in /etc/group. A group with the same name as a user is called a user private group. For more information on user private groups, refer to Section 33.1 Adding a New User.

    The line created in /etc/group has the following characteristics:

    • It begins with the group name juan.

    • An x appears in the password field indicating that the system is using shadow group passwords.

    • The GID matches the one listed for user juan in /etc/passwd.

  4. A new line for a group named juan is created in /etc/gshadow. The line has the following characteristics:

    • It begins with the group name juan.

    • An exclamation point (!) appears in the password field of the /etc/gshadow file, which locks the group.

    • All other fields are blank.

  5. A directory for user juan is created in the /home/ directory. This directory is owned by user juan and group juan. However, it has read, write, and execute privileges only for the user juan. All other permissions are denied.

  6. The files within the /etc/skel/ directory (which contain default user settings) are copied into the new /home/juan/ directory.

At this point, a locked account called juan exists on the system. To activate it, the administrator must next assign a password to the account using the passwd command and, optionally, set password aging guidelines.

 
 
  Published under the terms of the GNU General Public License Design by Interspire