Managing Users & Groups

Creating & Modifying Accounts

CommandPurpose
useradd -m -s /bin/bash aliceCreate user with home + shell
passwd aliceSet/change password
usermod -aG sudo aliceAppend to a supplementary group
usermod -L / -ULock / unlock account
userdel -r aliceDelete user and home
groupadd devsCreate group
groupdel devsDelete group
id aliceShow UID/GID/groups
chage -l alicePassword ageing info
$ useradd -m -s /bin/bash alice && id alice
uid=1001(alice) gid=1001(alice) groups=1001(alice)
Exam trap: Always use usermod -aG (append). Plain usermod -G replaces all supplementary groups and will silently remove the user from others.