Bookmark this page

Guided Exercise: Creating Users Using Command-line Tools

In this lab, you will create a number of users on your serverX system, setting and recording an initial password for each user.

Outcomes

A system with additional user accounts.

Reset your serverX system.

  1. Log into the GNOME desktop on serverX as student with a password of student.

  2. Open a window with a Bash prompt.

    Select ApplicationsUtilitiesTerminal.

  3. Become the root user at the shell prompt.

    [student@serverX ~]$ su -
    Password: redhat
  4. Add the user juliet.

    [root@serverX ~]# useradd juliet
  5. Confirm that juliet has been added by examining the /etc/passwd file.

    [root@serverX ~]# tail -2 /etc/passwd
    tcpdump:x:72:72::/:/sbin/nologin
    juliet:x:1001:1001::/home/juliet:/bin/bash
    
  6. Use the passwd command to initialize juliet's password.

    [root@serverX ~]# passwd juliet
    Changing password for user juliet.
    New password: juliet
    BAD PASSWORD: The password is shorter than 8 characters
    Retype new password: juliet
    passwd: all authentication tokens updated successfully.
  7. Continue adding the remaining users in the steps below and set initial passwords.

    1. romeo

      [root@serverX ~]# useradd romeo
      [root@serverX ~]# passwd romeo
      Changing password for user romeo.
      New password: romeo
      BAD PASSWORD: The password is shorter than 8 characters
      Retype new password: romeo
      passwd: all authentication tokens updated successfully.
    2. hamlet

      [root@serverX ~]# useradd hamlet
      [root@serverX ~]# passwd hamlet
    3. reba

      [root@serverX ~]# useradd reba
      [root@serverX ~]# passwd reba
    4. dolly

      [root@serverX ~]# useradd dolly
      [root@serverX ~]# passwd dolly
    5. elvis

      [root@serverX ~]# useradd elvis
      [root@serverX ~]# passwd elvis
Revision: rh124-7-1b00421