Show Menu
Cheatography

Linux Account Hardening Cheat Sheet (DRAFT) by

Commands for Account Hardening in Linux

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Password Management

Command
Purpose
passwd USER
Change password
passwd -l USER
Lock account password
passwd -u USER
Unlock account password
chage -l USER
View password aging
chage -M 90 USER
Maximum password age
chage -m 7 USER
Minimum password age
chage -W 7 USER
Warning days
chage -E YYYY-MM-DO USER
Expire account
 

MFA & Restricted Shell

Command
Purpose
chsh -s /bin/rbash USER
Restricted Bash
cat /etc/s­hells
List valid shells
echo %SHELL
Current shell
Common restricted shells:
rbash
nologin
false
 

faillock (Modern RHEL)

Command
Purpose
faillock
View failed logins
faillock --user USER
Failed attempts for user
faillock --reset --user USER
Reset lockout