What are user management commands?

QuestionsQuestions8 SkillsProUser Account ManagementOct, 22 2025
0224

User management commands in Linux are tools used to create, modify, and delete user accounts and manage user permissions. Here are some commonly used user management commands:

  1. useradd: Creates a new user account.

    sudo useradd username
  2. usermod: Modifies an existing user account. It can change the username, home directory, shell, and group memberships.

    sudo usermod -l new_username old_username  # Rename user
    sudo usermod -d /new/home/directory username  # Change home directory
    sudo usermod -aG groupname username  # Add user to a supplementary group
  3. userdel: Deletes a user account.

    sudo userdel username
  4. passwd: Changes a user's password.

    sudo passwd username
  5. chage: Changes user password expiry information.

    sudo chage -E YYYY-MM-DD username  # Set account expiration date
  6. id: Displays user and group information for a specified user.

    id username
  7. groups: Shows the groups a user belongs to.

    groups username
  8. who: Displays who is currently logged in.

    who
  9. w: Shows who is logged in and what they are doing.

    w

These commands are essential for managing user accounts and ensuring proper access control in a Linux environment.

0 Comments

no data
Be the first to share your comment!