Table of Contents
- What is a User in Linux?
- Types of Users in Linux
- Unique User Identification UID
- Where Linux Stores User Account Info
- Creating a User Account
- Setting or Changing a User Password
- Viewing User Account Properties
- Viewing User Password Properties
- Switching Users
- Deleting a User Account
- Conclusion
- Let’s Connect on LinkedIn
What is a User in Linux?
A user is anyone with a login account on the Linux system. Users can access the system based on their permissions and roles.
Example: On a shared development server, each DevOps engineer has their own user account to isolate their files and settings.
Types of Users in Linux
a. System Users
Created automatically during installation or when system services/apps are installed.
These accounts usually don’t have login privileges.
Examples: root, apache, mysql
b. Normal Users
Created by system administrators or via scripts.
Used for actual human users who log in and interact with the system.
Unique User Identification "UID"
Every user is assigned a UID.
UID Ranges:
0: Reserved for the root user (superuser).
1–999: Typically reserved for system users.
1000+: Normal human users created manually or during OS setup.
Scenario: When setting file permissions or troubleshooting ownership, Linux refers to UIDs, not usernames.
Where Linux Stores User Account Info
/etc/passwd: Contains essential user account data.
/etc/shadow: Stores encrypted passwords and password expiry info.
Creating a User Account
Adds a new user to the system.
Setting or Changing a User Password
passwd sophia will prompt you to enter a new password.
Viewing User Account Properties
Sample output:
sophia❌1001:1001::/home/sophia:/bin/bash
Fields explained:
chielo: Username
x: Password placeholder (real password stored in /etc/shadow)
1001: UID
1001: GID (Group ID)
(empty): User full name or comment field
/home/chielo: Home directory
/bin/bash: Default shell
Viewing User Password Properties
chielo:$6$bD...:20190:0:99999:7:::
Fields explained:
chielo: Username
$6$bD...: Encrypted password
20190: Days since Jan 1, 1970 when password was last changed
0: Minimum password age in days
99999: Maximum password age in days
7: Warning period before password expires
Empty fields: Password inactivity and expiry info
Switching Users
su
Temporarily switch to another user account.
Deleting a User Account
Remove the account but keep home directory:
userdel
Remove the account and delete home directory:
userdel -r
Example: After an employee leaves a company, an admin can delete their Linux user account with userdel -r to clean up space and revoke access.
Conclusion
User management in Linux is foundational for system security and multi-user environments. From creating users to understanding UID ranges and system files like /etc/passwd and /etc/shadow, getting comfortable with these operations is essential for anyone working on Linux systems.
Let’s Connect on LinkedIn
As I automate my journey into RHCE and Ansible, I’d love to connect with fellow learners and professionals. Feel free to reach out and join me as I share tips, resources, and insights throughout this 30-day challenge.
Top comments (2)
Great breakdown. Good job Engr 🙏🏻
Thank you 🙏