INFRA-DEVOPS Contents

Users, Groups, sudo, Capabilities

Harden access: users, groups, sudo policy, Linux capabilities, and least-privilege operational patterns.

On this page

Account Model for Operations

  • No shared root passwords; use named users and sudo.
  • Separate human access from service accounts.
  • Centralize auth (SSO/SSH CA) if available; log everything.

Sudo Policy: Minimal and Auditable

# Validate current sudo rights
sudo -l

# Example sudoers snippet (use visudo)
# %ops ALL=(root) NOPASSWD: /bin/systemctl status *, /bin/journalctl -u *

SSH Hardening (Operator Baseline)

# /etc/ssh/sshd_config
PermitRootLogin no
PasswordAuthentication no
AllowGroups ops

Linux Capabilities (When Root is Overkill)

  • Grant a process specific privileges without full root.
  • Typical: bind to low ports without root.
# allow binary to bind to :80/:443
setcap cap_net_bind_service=+ep /usr/local/bin/myservice
getcap /usr/local/bin/myservice

Failure Modes

  • Sudo sprawl: too-broad rules; tighten to exact commands.
  • Secret leakage: env vars and history; use safe tooling and redact logs.
  • Capability creep: track and periodically review getcap outputs.