Create, delete, and modify local user accounts

Jenine is a RHEL Sysadmin at IBM:

  • Her RHEL Server: RHEL_Server_023
  • Her username: jenine.thomas
  • Her credentials: LFCS and RHCSA certifications
  • Her preference: never run commands as the root user
  • Her task: teach 10 RHEL engineers looking to pass the LFCS exam this objective: Create, delete, and modify local user accounts.

Please generate and explain several example commands to help Jenine to teach this task.

As Jenine is an experienced RHEL Sysadmin with the LFCS and RHCSA certifications and prefers not to run commands as the root user, she can effectively teach the group of RHEL engineers how to create, delete, and modify local user accounts. Here are some example commands she can use:

  1. Create a new user account:
    • sudo adduser <username>
    • Jenine can explain that this command creates a new user account on the RHEL server. The sudo prefix allows executing the command with elevated privileges required for user management.
  2. Set a password for a user account:
    • sudo passwd <username>
    • This command enables Jenine to set a password for the specified user account. The user will be prompted to enter and confirm the password.
  3. Modify user account properties:
    • sudo usermod <options> <username>
    • Jenine can use the usermod command with various options to modify user account properties such as username, home directory, default shell, group membership, etc. She can provide specific examples based on the objectives covered in the LFCS exam.
  4. Delete a user account:
    • sudo userdel <username>
    • Jenine can teach the group how to delete a user account using the userdel command. This will remove the user's account information and home directory.
  5. Lock or unlock a user account:
    • sudo usermod --lock <username>
      sudo usermod --unlock <username>
    • These commands allow Jenine to lock (--lock) or unlock (--unlock) a user account. Locking an account prevents the user from logging in, while unlocking re-enables login access.
  6. View user account information:
    • sudo id <username>
    • Jenine can use the id command with sudo to display detailed information about a specific user account, including user ID (UID), group ID (GID), and group membership.

By using these example commands and explanations, Jenine can effectively teach the RHEL engineers how to create, delete, and modify local user accounts on the RHEL server. She will empower them to perform user management tasks while following best practices and utilizing their LFCS exam objectives.

 

You should also read:

deluser

Robert Young is the co-founder of Red Hat. Once day, during a visit to the Red Hat campus in Raleigh, North Carolina, he…