LICM cheat sheet
LICM · Keep the key ideas within reach.
Security and File Permissions
Permission triples apply to user, group, and other; r=4, w=2, x=1, so rwxr-xr-- equals 754; directories need x to be entered and r to list contents.
Special bits: setuid (4) runs a file as its owner, setgid (2) runs as the file's group or makes a directory inherit its group, sticky (1) on a directory lets only owners delete their files (e.g., /tmp is 1777).
chmod, chown, and chgrp change mode, owner, and group; only root or the file owner may change permissions, and only root may change ownership.
User accounts live in /etc/passwd, hashed passwords in /etc/shadow (readable only by root), groups in /etc/group; useradd, usermod, userdel, and passwd manage them.
sudo grants command-level privilege escalation configured in /etc/sudoers via visudo; su switches user identity and requires the target account's password.
SSH security: keys are generated with ssh-keygen, the public key is placed in ~/.ssh/authorized_keys, and /etc/ssh/sshd_config controls options such as PermitRootLogin and PasswordAuthentication.
File searching by permission: find / -perm -4000 -type f lists setuid files; find with -user, -group, and -perm aids security audits.
umask determines default permissions: files start at 666 and directories at 777, then masked bits are removed; umask 027 yields 640 files and 750 directories.