Account

Account in Linux

  • Definition: A user account in Linux represents a unique identity used to log in and interact with the system.
  • Structure:
  • /etc/passwd: Stores user account information.
    • Format: username:x:UID:GID:comment:home_directory:shell
    • Example: john:x:1001:1001:John Doe:/home/john:/bin/bash
  • /etc/shadow: Stores encrypted passwords and password-related information.
    • Format: username:encrypted_password:last_change:min:max:warn:inactive:expire:flag
  • /etc/group: Defines user groups.
    • Format: group_name:x:GID:user_list
    • Example: developers:x:1002:john,mary
  • Home Directory: /home/username
    • Contains user-specific files and settings.
    • Example: /home/john for user ‘john’.
  • Purpose:
  • Provides personalized environments.
  • Controls access to files, processes, and system resources.
  • Allows for user-specific configurations and data storage.
  • Key Files and Directories:
  • /home/: Directory where all user home directories reside.
  • /etc/passwd: Main user account information file.
  • /etc/shadow: Secure storage of user passwords.
  • /etc/group: Group membership definitions.

Uses in Linux:

  • Authentication: Verifies user identity during login.
  • Authorization: Grants permissions to access files and execute commands.
  • Customization: Allows users to have personal settings and preferences.
  • Resource Management: Isolates user processes and files for security and organization.

Key Points:

  • Essential for multi-user environment management.
  • Supports both individual and group-based permissions.
  • Configurable through command-line tools like useradd, usermod, and passwd.

Leave a Reply

Your email address will not be published. Required fields are marked *