Users
Cheat sheet · https://pcornel.dk/topic.php?topic=2697
Answer
A Linux user account has a name, UID, primary group, home directory and login shell (in /etc/passwd) and a password hash (in /etc/shadow). System accounts run services; regular accounts are for people.
Remember
Create with useradd -m -s /bin/bash <user> (or adduser on Debian), set the password with passwd, lock with usermod -L or passwd -l. A shell of /usr/sbin/nologin blocks interactive login. Directory users (LDAP/AD via SSSD) appear in getent but not in /etc/passwd.
First checks
chage -l <user>— password ageing and expiryid <user>— UID, primary group and groupsgetent passwd <user>— account entry (local or directory)getent group <group>— group memberssudo -l -U <user>— what the user may run with sudo
Commands
getent passwd <name>id alicegetent passwd alice
Verify in this order
account in passwd/directory → password or key valid and not expired → shell allowed → home available → session starts
Where it usually breaks
First mismatch in identity/group resolution → Unix mode/ACL/capability → mount/sandbox constraint → SELinux/AppArmor policy → credential/TLS trust → protected operation; preserve identity/native diagnostic/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2697