Skip to content

User Management in Linux

A user account in Linux is an identity used to access and interact with the system. It defines permissions, ownership of files, and access to system resources.

User Accounts Attributes

Attribute Location (Field/Line) Description
Username /etc/passwd1st field Unique name identifying the user.
User ID (UID) /etc/passwd3rd field Numeric identifier for the user.
Group ID (GID) /etc/passwd4th field Primary group ID associated with the user.
Supplementary Groups /etc/grouplines where user appears Additional groups the user belongs to.
Home Directory /etc/passwd6th field Default directory assigned to the user.
Shell /etc/passwd7th field Default command-line interpreter (e.g., /bin/bash).
Password (hashed) /etc/shadow2nd field Encrypted password for authentication.
Account Expiry Date /etc/shadow8th field Date when the account becomes inactive.
Password Expiry Date /etc/shadow5th field Date when the password must be changed.
Minimum Password Age /etc/shadow3rd field Minimum days before password can be changed.
Maximum Password Age /etc/shadow4th field Maximum days before password must be changed.
Password Warning Period /etc/shadow6th field Days before expiry to warn user.
Inactive Period /etc/shadow7th field Days after password expiry before account is disabled.
Account Status passwd -Soutput status field Indicates if account is active or locked.
Login History lastlines per login event Records of user logins.
Failed Login Attempts faillogper-user entry Tracks unsuccessful login attempts.
Full Name (GECOS) /etc/passwd5th field User’s full name and optional info (comma-separated).
Email Address GECOS or external systems Can be manually added or managed via LDAP/email systems.
Office Location /etc/passwdGECOS field (2nd item) Optional field for user’s office location.
Work/Home Phone /etc/passwdGECOS field (3rd/4th items) Optional phone numbers.
Custom Metadata LDAP or external identity systems Additional attributes like department, title, etc.