Password Hardening
Password Policy Configuration
PAM (Pluggable Authentication Modules) Setup
PAM allows sophisticated password policy implementation in Linux systems:
graph TD
A[PAM Configuration] --> B[Password Complexity]
A --> C[Password History]
A --> D[Account Lockout]
Configuring /etc/security/pwquality.conf
## Minimum password length
minlen = 12
## Require at least one uppercase letter
ucredit = -1
## Require at least one lowercase letter
lcredit = -1
## Require at least one numeric character
dcredit = -1
## Require at least one special character
ocredit = -1
Advanced Password Protection Strategies
Password Strength Validation
Strategy |
Implementation |
Minimum Length |
12-16 characters |
Character Diversity |
Mix uppercase, lowercase, numbers, symbols |
Dictionary Check |
Prevent common word usage |
Repeated Character Restriction |
Limit consecutive character repetitions |
Password Aging Configuration
## Set password expiration for a user
sudo chage -M 90 username
## Force immediate password change
sudo passwd -e username
Secure Password Generation
Generating Strong Passwords
## Generate random password
openssl rand -base64 16
## Generate password with specific complexity
pwgen -sy 16 1
Multi-Factor Authentication
MFA Implementation Techniques
graph TD
A[Multi-Factor Authentication] --> B[SSH Key]
A --> C[Google Authenticator]
A --> D[Hardware Tokens]
Installing Google Authenticator
## Install Google Authenticator
sudo apt-get install libpam-google-authenticator
## Configure for individual user
google-authenticator
Monitoring and Auditing
Failed Login Tracking
## View recent login attempts
last
## Check authentication logs
sudo grep 'Failed' /var/log/auth.log
LabEx Security Recommendations
- Regularly update password policies
- Implement comprehensive authentication strategies
- Use centralized authentication mechanisms
- Continuously monitor system access logs
By applying these password hardening techniques, Linux administrators can significantly enhance system security and protect against unauthorized access.