Managing Login Definitions
Learn how to manage system-wide login definitions, password aging policies, and default user account settings using the /etc/login.defs file.
Overview
The /etc/login.defs file controls many of the default account creation and password policy settings used on Linux systems. In this lab, you will learn how to manage system-wide login definitions that affect user accounts, password aging, and user ID allocation. You will explore and modify settings related to password expiration, warning periods, minimum password age, and default UID/GID ranges. You will also verify how these settings affect newly created user accounts and generate a configuration report.
In This Lab, You’ll Learn How To
- View and understand the login.defs configuration file
- Manage default password aging policies
- Configure password expiration and warning periods
- Modify default UID and GID allocation ranges
- Verify account settings for newly created users
- Generate reports from login definition settings
- Restore default login configuration values
Key Login Definition Settings
PASS_MAX_DAYSfor maximum password agePASS_MIN_DAYSfor minimum password agePASS_WARN_AGEfor password expiration warningsUID_MINfor the starting user ID rangeGID_MINfor the starting group ID rangechagefor verifying password aging policies
Command Examples
View the login definitions file:
cat /etc/login.defs
Check password aging settings:
grep '^PASS_MAX_DAYS' /etc/login.defs
grep '^PASS_MIN_DAYS' /etc/login.defs
grep '^PASS_WARN_AGE' /etc/login.defs
Check UID and GID ranges:
grep '^UID_MIN' /etc/login.defs
grep '^GID_MIN' /etc/login.defs
Verify password aging information for a user:
chage -l testuser1
Create a user to test default settings:
useradd testuser1
Learning Outcomes
- Understand the role of /etc/login.defs in Linux
- Configure system-wide password policies
- Manage default account creation settings
- Verify password aging and user allocation settings
- Develop practical Linux administration skills
Conclusion
Completing this lab will help you gain practical experience managing login definitions and default account policies in Linux. You will learn how to configure password aging settings and account creation parameters that apply across the entire system. These skills are valuable for Linux system administration, LFCS preparation, and maintaining consistent security policies for user accounts.