Tag: sudo

Linux User & Service Management: useradd, sudo, systemctl, journalctl

Working reference for Linux user and service management. The /etc/passwd / shadow / group files behind the tools, useradd vs adduser (scripting vs interactive), the critical usermod -aG (vs -G alone wiping groups), su vs sudo with sudo as the preferred default, visudo and per-file /etc/sudoers.d/ drop-ins, group management with groupadd / gpasswd. The systemd toolkit: systemctl start / stop / restart / reload / enable / disable / mask, list-units --state=failed, daemon-reload after unit edits, journalctl with -u SERVICE -f / -p err / --since / -b -1 previous boot / --vacuum-time. Minimal custom unit file template. Pitfalls: usermod -G without -a, editing sudoers with vim directly, forgetting daemon-reload, restart instead of reload, userdel -r vs without.