Like this CertiGuide? Get it in PDF format!
Click Here!

Custom Search







Table Of Contents  CertiGuide to A+ (A+ 4 Real)
 9  Chapter 5: The Linux Operating System
      9  Command Line Functions And Administrative Utilities
           9  User Management Commands

Previous Topic/Section
whoami - Print Effective UserID
Previous Page
Pages in Current Topic/Section
1
Next Page
passwd - Update A User’s Authentication Tokens (Password)
Next Topic/Section

useradd - Create A New User

Although a user can be added to the system by directly editing the /etc/passwd file, a much safer way to add users is by this command. A mistake in editing the passwd has potentially serious effects and additional information must be added to the actual password file /etc/shadow. For example changing the shell for any account to a nonexistent shell will lock out that account, which is very serious if that happens to the root account. The author speaks from experience having recently done exactly that. The only recovery from this type of mistake is to reboot the system from a rescue CD and repair the passwd file. Adding users through the useradd command will prevent any such accidents. Notice that from the chart the two options, the d and s options, will override some system defaults when adding a user. An example using this command is:

useradd newuser -c user_full_name -d /home/newuser -s /bin/bash

This would add a new user with the userid of newuser, a home directory of /home/newuser, and a default shell of bash. It would also create the user’s home directory and copy any files in the /etc/skel directory into the new user directory, properly initializing this new account as well as storing the users full name in the comment field in the /etc/passwd file.

Some versions of useradd will also create a group with this account name. Check your system command page for useradd to find out whether or not your system will create a group with this command.

Password Security

Passwords are usually stored in the /etc/shadow file in the form of a one-way hash. This file is setup with very tight privileges to prevent users from viewing the stored passwords. Even if this file is viewed, the stored hashed passwords cannot be decrypted. Note however, there are potential ways of figuring out a password for a hash, so do not modify the read/write privileges for this file.



Previous Topic/Section
whoami - Print Effective UserID
Previous Page
Pages in Current Topic/Section
1
Next Page
passwd - Update A User’s Authentication Tokens (Password)
Next Topic/Section

If you find CertiGuide.com useful, please consider making a small Paypal donation to help the site, using one of the buttons below. You can also donate a custom amount using the far right button (not less than $1 please, or PayPal gets most/all of your money!) In lieu of a larger donation, you may wish to consider buying an inexpensive PDF equivalent of the CertiGuide to A+ (A+ 4 Real) from StudyExam4Less.com. Thanks for your support!
Donate $2
Donate $5
Donate $10
Donate $20
Donate $30
Donate: $



Home - Table Of Contents - Contact Us

CertiGuide to A+ (A+ 4 Real) (http://www.CertiGuide.com/apfr/) on CertiGuide.com
Version 1.0 - Version Date: March 29, 2005

Adapted with permission from a work created by Tcat Houser et al.
CertiGuide.com Version Copyright 2005 Charles M. Kozierok. All Rights Reserved.
Not responsible for any loss resulting from the use of this site.