Interview Prep/Linux/Users, groups and access control

Developers keep running `sudo su -` and doing everything as root. How do you change that without blocking their work?

IntermediateScenarioUsers, groups and access control
Answer

Situation read → Shared root sessions destroy accountability; replace with per-command sudo.

What I'd do →

  1. List what they actually need (restart services, read logs, deploy) from sudo logs.
  2. Write Cmnd_Alias rules for those commands in /etc/sudoers.d/.
  3. Remove the broad ALL rule, and explicitly deny shells: !/bin/su, !/usr/bin/su, !/bin/bash (as defence, knowing deny lists are bypassable).
  4. Give the team journalctl access via the systemd-journal group instead of sudo.
  5. Communicate, roll out to one server, then the fleet.

Why → Every action gets tied to a named user in the logs.

Interview tip → Admit deny lists in sudo are weak; allow lists are the real control.

All Linux questions Roadmap: Linux

More on Users, groups and access control