What are common user management commands?

QuestionsQuestions8 SkillsProUser Account ManagementNov, 22 2025
0103

Common user management commands in Linux include:

  1. Add a User:

    sudo useradd username
  2. Delete a User:

    sudo userdel username
  3. Modify a User:

    • Change username:
      sudo usermod -l new_username old_username
    • Change home directory:
      sudo usermod -d /new/home/directory -m username
    • Add user to supplementary groups:
      sudo usermod -aG groupname username
    • Change login shell:
      sudo usermod -s /path/to/shell username
    • Set account expiration date:
      sudo usermod -e YYYY-MM-DD username
  4. View User Information:

    • Display user ID and group ID:
      id username
    • View password aging information:
      chage -l username
  5. List All Users:

    cat /etc/passwd

These commands provide a comprehensive toolkit for managing user accounts and their attributes in a Linux environment.

0 Comments

no data
Be the first to share your comment!