Users, Groups & sudo — Linux Administration & Deployment
Linux is multi-user. Each process runs as a user, which determines what it may access. File Holds /etc/passwd accounts (name, UID, home, shell) /etc/shadow password hashes (root-only) /etc/group groups and members /etc/sudoers + /etc/sudoers.d/ who may run what as root (edit with visudo) Principles Log in as a normal user; use sudo for admin tasks — avoid working as root. Run services under dedicated system users without login shells (--system --shell /usr/sbin/nologin). Grant access via groups (docker, www-data, sudo/wheel) rather than per-user permissions. Group changes apply at next login (or newgrp).
Key Takeaways
Use a normal account plus sudo; avoid logging in as root.
Run each service as its own unprivileged system user.
Always use usermod -aG (append) when adding groups.
Scope sudo rules to specific commands and validate with visudo -c.