Skip to content

Latest commit

 

History

History
90 lines (65 loc) · 1.41 KB

File metadata and controls

90 lines (65 loc) · 1.41 KB

Linux Commands

📁 Important Files

File Path Description
/etc/passwd Stores user account information
/etc/shadow Stores user passwords and password aging data
/etc/group Stores group information
/etc/sudoers Defines users/groups allowed to run sudo

👤 User Management

  • View user info:

      grep -i ^bob /etc/passwd

    Example Output:

    bob:x:1002:1002::/home/bob:/bin/sh
    
    USERNAME:PASSWORD:UID:GID:GECOS:HOMEDIR:SHELL
    
  • Change password:

    passwd             # For current user
    passwd <username> # For specific user
  • Delete a user:

    userdel <username>

🔐 Password Details

  • View password entry:

    grep -i ^bob /etc/shadow

    Example Output:

    bob:$6$...:18188:0:99999:7:::
    
    USERNAME:PASSWORD:LASTCHANGE:MINAGE:MAXAGE:WARN:INACTIVE:EXPDATE
    

👥 Group Management

  • Add a group:

    groupadd <groupname>
  • Delete a group:

    groupdel <groupname>
  • View user's group memberships:

    grep -i ^bob /etc/group
    GROUPNAME:PASSWORD:GID:MEMBERS
    
  • Reset the shell Cache

hash -r