Skip to content

Instantly share code, notes, and snippets.

Command Purpose Expected Result
useradd -e 2024-03-28 james Create user with expiry User created successfully
passwd james Set password Password set
chage -l james Check expiry Expiry shows Mar 28, 2024
Step Description Command
1 SSH into App Server 2 ssh steve@stapp02
2 Verify user doesn’t exist grep mariyam /etc/passwd
3 Create user with non-interactive shell sudo useradd -s /sbin/nologin mariyam
4 Confirm configuration grep mariyam /etc/passwd
5 Test shell restriction su - mariyam